@tolt/api 0.7.0 → 1.0.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/BaseClient.js +1 -0
- package/dist/Client.d.ts +3 -3
- package/dist/Client.js +3 -3
- package/dist/api/errors/BadRequestError.d.ts +2 -2
- package/dist/api/errors/ConflictError.d.ts +2 -2
- package/dist/api/errors/ContentTooLargeError.d.ts +2 -2
- package/dist/api/errors/NotFoundError.d.ts +2 -2
- package/dist/api/errors/TooManyRequestsError.d.ts +2 -2
- package/dist/api/errors/UnauthorizedError.d.ts +2 -2
- package/dist/api/resources/clicks/client/Client.d.ts +10 -7
- package/dist/api/resources/clicks/client/Client.js +82 -68
- package/dist/api/resources/clicks/client/requests/CreateClickRequest.d.ts +28 -0
- package/dist/api/resources/clicks/client/requests/{GetClicksRequest.d.ts → GetClickRequest.d.ts} +1 -1
- package/dist/api/resources/clicks/client/requests/index.d.ts +2 -1
- package/dist/api/resources/clicks/types/{CreateClicksResponse.d.ts → CreateClickResponse.d.ts} +1 -1
- package/dist/api/resources/clicks/types/{GetClicksResponse.d.ts → GetClickResponse.d.ts} +1 -1
- package/dist/api/resources/clicks/types/index.d.ts +2 -3
- package/dist/api/resources/clicks/types/index.js +2 -3
- package/dist/api/resources/commissions/client/Client.d.ts +19 -15
- package/dist/api/resources/commissions/client/Client.js +94 -76
- package/dist/api/resources/commissions/client/requests/{DeleteCommissionsRequest.d.ts → ApproveCommissionRequest.d.ts} +1 -1
- package/dist/api/resources/commissions/client/requests/CreateCommissionRequest.d.ts +40 -0
- package/dist/api/resources/commissions/client/requests/CreateCommissionRequest.js +9 -0
- package/dist/api/resources/commissions/client/requests/{DeclineCommissionsRequest.d.ts → DeclineCommissionRequest.d.ts} +1 -1
- package/dist/api/resources/commissions/client/requests/{ApproveCommissionsRequest.d.ts → DeleteCommissionRequest.d.ts} +1 -1
- package/dist/api/resources/commissions/client/requests/{GetCommissionsRequest.d.ts → GetCommissionRequest.d.ts} +1 -1
- package/dist/api/resources/commissions/client/requests/{UpdateCommissionsRequest.d.ts → UpdateCommissionRequest.d.ts} +3 -3
- package/dist/api/resources/commissions/client/requests/UpdateCommissionRequest.js +9 -0
- package/dist/api/resources/commissions/client/requests/index.d.ts +6 -5
- package/dist/api/resources/commissions/client/requests/index.js +2 -1
- package/dist/api/resources/commissions/types/{UpdateCommissionsResponse.d.ts → ApproveCommissionResponse.d.ts} +1 -1
- package/dist/api/resources/commissions/types/{DeleteCommissionsResponse.d.ts → CreateCommissionResponse.d.ts} +1 -1
- package/dist/api/resources/commissions/types/{CreateCommissionsResponse.d.ts → DeclineCommissionResponse.d.ts} +1 -1
- package/dist/api/resources/commissions/types/DeleteCommissionResponse.d.ts +6 -0
- package/dist/api/resources/commissions/types/{GetCommissionsResponse.d.ts → GetCommissionResponse.d.ts} +1 -1
- package/dist/api/resources/commissions/types/UpdateCommissionResponse.d.ts +6 -0
- package/dist/api/resources/commissions/types/index.d.ts +6 -7
- package/dist/api/resources/commissions/types/index.js +6 -7
- package/dist/api/resources/customers/client/Client.d.ts +9 -10
- package/dist/api/resources/customers/client/Client.js +84 -71
- package/dist/api/resources/customers/client/requests/{CreateCustomersRequest.d.ts → CreateCustomerRequest.d.ts} +3 -3
- package/dist/api/resources/customers/client/requests/{CreateCustomersRequest.js → CreateCustomerRequest.js} +4 -4
- package/dist/api/resources/customers/client/requests/{DeleteCustomersRequest.d.ts → DeleteCustomerRequest.d.ts} +1 -1
- package/dist/api/resources/customers/client/requests/{GetCustomersRequest.d.ts → GetCustomerRequest.d.ts} +1 -1
- package/dist/api/resources/customers/client/requests/{UpdateCustomersRequest.d.ts → UpdateCustomerRequest.d.ts} +3 -3
- package/dist/api/resources/customers/client/requests/{UpdateCustomersRequest.js → UpdateCustomerRequest.js} +4 -4
- package/dist/api/resources/customers/client/requests/index.d.ts +4 -4
- package/dist/api/resources/customers/client/requests/index.js +2 -2
- package/dist/api/resources/customers/types/{DeleteCustomersResponse.d.ts → CreateCustomerResponse.d.ts} +1 -1
- package/dist/api/resources/customers/types/{UpdateCustomersResponse.d.ts → DeleteCustomerResponse.d.ts} +1 -1
- package/dist/api/resources/customers/types/{GetCustomersResponse.d.ts → GetCustomerResponse.d.ts} +1 -1
- package/dist/api/resources/customers/types/{CreateCustomersResponse.d.ts → UpdateCustomerResponse.d.ts} +1 -1
- package/dist/api/resources/customers/types/index.d.ts +4 -4
- package/dist/api/resources/customers/types/index.js +4 -4
- package/dist/api/resources/{embed → embedTokens}/client/Client.d.ts +9 -11
- package/dist/api/resources/{embed → embedTokens}/client/Client.js +7 -9
- package/dist/api/resources/embedTokens/client/index.d.ts +1 -0
- package/dist/api/resources/embedTokens/client/index.js +1 -0
- package/dist/api/resources/embedTokens/client/requests/CreateEmbedTokenRequest.d.ts +21 -0
- package/dist/api/resources/embedTokens/client/requests/index.d.ts +1 -0
- package/dist/api/resources/embedTokens/exports.d.ts +2 -0
- package/dist/api/resources/{embed → embedTokens}/exports.js +1 -1
- package/dist/api/resources/{embed/types/CreateTokenEmbedResponse.d.ts → embedTokens/types/CreateEmbedTokenResponse.d.ts} +1 -1
- package/dist/api/resources/embedTokens/types/index.d.ts +1 -0
- package/dist/api/resources/embedTokens/types/index.js +1 -0
- package/dist/api/resources/flows/client/Client.d.ts +3 -4
- package/dist/api/resources/flows/client/Client.js +74 -64
- package/dist/api/resources/flows/client/requests/{GetFlowsRequest.d.ts → GetFlowRequest.d.ts} +1 -1
- package/dist/api/resources/flows/client/requests/ListFlowsRequest.d.ts +1 -1
- package/dist/api/resources/flows/client/requests/index.d.ts +1 -1
- package/dist/api/resources/flows/types/{GetFlowsResponse.d.ts → GetFlowResponse.d.ts} +1 -1
- package/dist/api/resources/flows/types/index.d.ts +1 -2
- package/dist/api/resources/flows/types/index.js +1 -2
- package/dist/api/resources/groups/client/Client.d.ts +3 -4
- package/dist/api/resources/groups/client/Client.js +71 -61
- package/dist/api/resources/groups/client/requests/{GetGroupsRequest.d.ts → GetGroupRequest.d.ts} +1 -1
- package/dist/api/resources/groups/client/requests/ListGroupsRequest.d.ts +1 -1
- package/dist/api/resources/groups/client/requests/index.d.ts +1 -1
- package/dist/api/resources/groups/types/{GetGroupsResponse.d.ts → GetGroupResponse.d.ts} +1 -1
- package/dist/api/resources/groups/types/index.d.ts +1 -2
- package/dist/api/resources/groups/types/index.js +1 -2
- package/dist/api/resources/index.d.ts +3 -2
- package/dist/api/resources/index.js +3 -2
- package/dist/api/resources/links/client/Client.d.ts +11 -12
- package/dist/api/resources/links/client/Client.js +80 -70
- package/dist/api/resources/links/client/requests/{CreateLinksRequest.d.ts → CreateLinkRequest.d.ts} +1 -1
- package/dist/api/resources/links/client/requests/{DeleteLinksRequest.d.ts → DeleteLinkRequest.d.ts} +1 -1
- package/dist/api/resources/links/client/requests/{GetByParamValueLinksRequest.d.ts → GetLinkByParamValueRequest.d.ts} +1 -1
- package/dist/api/resources/links/client/requests/{GetLinksRequest.d.ts → GetLinkRequest.d.ts} +1 -1
- package/dist/api/resources/links/client/requests/{UpdateLinksRequest.d.ts → UpdateLinkRequest.d.ts} +1 -1
- package/dist/api/resources/links/client/requests/index.d.ts +5 -5
- package/dist/api/resources/links/types/{DeleteLinksResponse.d.ts → CreateLinkResponse.d.ts} +1 -1
- package/dist/api/resources/links/types/{CreateLinksResponse.d.ts → DeleteLinkResponse.d.ts} +1 -1
- package/dist/api/resources/links/types/GetLinkByParamValueResponse.d.ts +6 -0
- package/dist/api/resources/links/types/{GetLinksResponse.d.ts → GetLinkResponse.d.ts} +1 -1
- package/dist/api/resources/links/types/{UpdateLinksResponse.d.ts → UpdateLinkResponse.d.ts} +1 -1
- package/dist/api/resources/links/types/index.d.ts +5 -5
- package/dist/api/resources/links/types/index.js +5 -5
- package/dist/api/resources/partners/client/Client.d.ts +13 -14
- package/dist/api/resources/partners/client/Client.js +82 -72
- package/dist/api/resources/partners/client/requests/{ApprovePartnersRequest.d.ts → ApprovePartnerRequest.d.ts} +1 -1
- package/dist/api/resources/partners/client/requests/{CreatePartnersRequest.d.ts → CreatePartnerRequest.d.ts} +4 -4
- package/dist/api/resources/partners/client/requests/{CreatePartnersRequest.js → CreatePartnerRequest.js} +4 -4
- package/dist/api/resources/partners/client/requests/{GetPartnersRequest.d.ts → GetPartnerRequest.d.ts} +1 -1
- package/dist/api/resources/partners/client/requests/{RejectPartnersRequest.d.ts → RejectPartnerRequest.d.ts} +1 -1
- package/dist/api/resources/partners/client/requests/{SuspendPartnersRequest.d.ts → SuspendPartnerRequest.d.ts} +1 -1
- package/dist/api/resources/partners/client/requests/{UpdatePartnersRequest.d.ts → UpdatePartnerRequest.d.ts} +1 -1
- package/dist/api/resources/partners/client/requests/index.d.ts +6 -6
- package/dist/api/resources/partners/client/requests/index.js +1 -1
- package/dist/api/resources/partners/types/{RejectPartnersResponse.d.ts → ApprovePartnerResponse.d.ts} +1 -1
- package/dist/api/resources/partners/types/{CreatePartnersResponse.d.ts → CreatePartnerResponse.d.ts} +1 -1
- package/dist/api/resources/partners/types/{GetPartnersResponse.d.ts → GetPartnerResponse.d.ts} +1 -1
- package/dist/api/resources/partners/types/{UpdatePartnersResponse.d.ts → RejectPartnerResponse.d.ts} +1 -1
- package/dist/api/resources/partners/types/{ApprovePartnersResponse.d.ts → SuspendPartnerResponse.d.ts} +1 -1
- package/dist/api/resources/partners/types/{SuspendPartnersResponse.d.ts → UpdatePartnerResponse.d.ts} +1 -1
- package/dist/api/resources/partners/types/index.d.ts +6 -6
- package/dist/api/resources/partners/types/index.js +6 -6
- package/dist/api/resources/programs/client/Client.d.ts +3 -4
- package/dist/api/resources/programs/client/Client.js +69 -59
- package/dist/api/resources/programs/client/requests/{GetProgramsRequest.d.ts → GetProgramRequest.d.ts} +1 -1
- package/dist/api/resources/programs/client/requests/index.d.ts +1 -1
- package/dist/api/resources/programs/types/{GetProgramsResponse.d.ts → GetProgramResponse.d.ts} +1 -1
- package/dist/api/resources/programs/types/index.d.ts +1 -1
- package/dist/api/resources/programs/types/index.js +1 -1
- package/dist/api/resources/promotionCodes/client/Client.d.ts +9 -10
- package/dist/api/resources/promotionCodes/client/Client.js +81 -68
- package/dist/api/resources/promotionCodes/client/requests/{CreatePromotionCodesRequest.d.ts → CreatePromotionCodeRequest.d.ts} +3 -3
- package/dist/api/resources/promotionCodes/client/requests/{CreatePromotionCodesRequest.js → CreatePromotionCodeRequest.js} +4 -4
- package/dist/api/resources/promotionCodes/client/requests/{DeletePromotionCodesRequest.d.ts → DeletePromotionCodeRequest.d.ts} +1 -1
- package/dist/api/resources/promotionCodes/client/requests/{GetPromotionCodesRequest.d.ts → GetPromotionCodeRequest.d.ts} +1 -1
- package/dist/api/resources/promotionCodes/client/requests/{UpdatePromotionCodesRequest.d.ts → UpdatePromotionCodeRequest.d.ts} +3 -3
- package/dist/api/resources/promotionCodes/client/requests/{UpdatePromotionCodesRequest.js → UpdatePromotionCodeRequest.js} +4 -4
- package/dist/api/resources/promotionCodes/client/requests/index.d.ts +4 -4
- package/dist/api/resources/promotionCodes/client/requests/index.js +2 -2
- package/dist/api/resources/promotionCodes/types/{CreatePromotionCodesResponse.d.ts → CreatePromotionCodeResponse.d.ts} +1 -1
- package/dist/api/resources/promotionCodes/types/{DeletePromotionCodesResponse.d.ts → DeletePromotionCodeResponse.d.ts} +1 -1
- package/dist/api/resources/promotionCodes/types/{GetPromotionCodesResponse.d.ts → GetPromotionCodeResponse.d.ts} +1 -1
- package/dist/api/resources/promotionCodes/types/{UpdatePromotionCodesResponse.d.ts → UpdatePromotionCodeResponse.d.ts} +1 -1
- package/dist/api/resources/promotionCodes/types/index.d.ts +4 -4
- package/dist/api/resources/promotionCodes/types/index.js +4 -4
- package/dist/api/resources/reports/client/Client.d.ts +12 -14
- package/dist/api/resources/reports/client/Client.js +158 -119
- package/dist/api/resources/reports/client/requests/{CustomerStatsReportsRequest.d.ts → ReportsCustomersRequest.d.ts} +1 -1
- package/dist/api/resources/reports/client/requests/{LinksReportsRequest.d.ts → ReportsLinksRequest.d.ts} +1 -1
- package/dist/api/resources/reports/client/requests/{OverviewReportsRequest.d.ts → ReportsOverviewRequest.d.ts} +1 -1
- package/dist/api/resources/reports/client/requests/{PartnersReportsRequest.d.ts → ReportsPartnersRequest.d.ts} +1 -1
- package/dist/api/resources/reports/client/requests/{TimeseriesReportsRequest.d.ts → ReportsTimeseriesRequest.d.ts} +1 -1
- package/dist/api/resources/reports/client/requests/index.d.ts +5 -5
- package/dist/api/resources/reports/types/{CustomerStatsReportsResponse.d.ts → ReportsCustomersResponse.d.ts} +1 -1
- package/dist/api/resources/reports/types/{LinksReportsResponse.d.ts → ReportsLinksResponse.d.ts} +1 -1
- package/dist/api/resources/reports/types/{OverviewReportsResponse.d.ts → ReportsOverviewResponse.d.ts} +1 -1
- package/dist/api/resources/reports/types/{PartnersReportsResponse.d.ts → ReportsPartnersResponse.d.ts} +1 -1
- package/dist/api/resources/reports/types/{TimeseriesReportsResponse.d.ts → ReportsTimeseriesResponse.d.ts} +1 -1
- package/dist/api/resources/reports/types/index.d.ts +5 -5
- package/dist/api/resources/reports/types/index.js +5 -5
- package/dist/api/resources/transactions/client/Client.d.ts +13 -14
- package/dist/api/resources/transactions/client/Client.js +87 -74
- package/dist/api/resources/transactions/client/requests/{CreateTransactionsRequest.d.ts → CreateTransactionRequest.d.ts} +1 -1
- package/dist/api/resources/transactions/client/requests/{DeleteTransactionsRequest.d.ts → DeleteTransactionRequest.d.ts} +1 -1
- package/dist/api/resources/transactions/client/requests/{GetTransactionsRequest.d.ts → GetTransactionRequest.d.ts} +1 -1
- package/dist/api/resources/transactions/client/requests/{RefundTransactionsRequest.d.ts → RefundTransactionRequest.d.ts} +1 -1
- package/dist/api/resources/transactions/client/requests/{RerunFlowsTransactionsRequest.d.ts → RerunTransactionFlowsRequest.d.ts} +1 -1
- package/dist/api/resources/transactions/client/requests/{UpdateTransactionsRequest.d.ts → UpdateTransactionRequest.d.ts} +1 -1
- package/dist/api/resources/transactions/client/requests/index.d.ts +6 -6
- package/dist/api/resources/transactions/types/{CreateTransactionsResponse.d.ts → CreateTransactionResponse.d.ts} +1 -1
- package/dist/api/resources/transactions/types/{DeleteTransactionsResponse.d.ts → DeleteTransactionResponse.d.ts} +1 -1
- package/dist/api/resources/transactions/types/{GetTransactionsResponse.d.ts → GetTransactionResponse.d.ts} +1 -1
- package/dist/api/resources/transactions/types/{RefundTransactionsResponse.d.ts → RefundTransactionResponse.d.ts} +1 -1
- package/dist/api/resources/transactions/types/{RerunFlowsTransactionsResponse.d.ts → RerunTransactionFlowsResponse.d.ts} +1 -1
- package/dist/api/resources/transactions/types/UpdateTransactionResponse.d.ts +6 -0
- package/dist/api/resources/transactions/types/index.d.ts +6 -6
- package/dist/api/resources/transactions/types/index.js +6 -6
- package/dist/api/types/{Error_.d.ts → ErrorResponse.d.ts} +4 -4
- package/dist/api/types/{Error_.js → ErrorResponse.js} +4 -4
- package/dist/api/types/index.d.ts +1 -1
- package/dist/api/types/index.js +1 -1
- package/dist/core/exports.d.ts +1 -0
- package/dist/core/exports.js +1 -0
- package/dist/core/fetcher/Fetcher.js +35 -4
- package/dist/core/fetcher/getErrorResponseBody.js +21 -8
- package/dist/core/fetcher/getResponseBody.d.ts +16 -0
- package/dist/core/fetcher/getResponseBody.js +26 -22
- package/dist/core/fetcher/makePassthroughRequest.js +18 -2
- package/dist/core/fetcher/makeRequest.d.ts +6 -1
- package/dist/core/fetcher/makeRequest.js +45 -13
- package/dist/core/fetcher/requestWithRetries.d.ts +1 -1
- package/dist/core/fetcher/requestWithRetries.js +23 -2
- package/dist/core/fetcher/signals.d.ts +1 -0
- package/dist/core/fetcher/signals.js +1 -1
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +2 -0
- package/dist/core/pagination/Page.d.ts +33 -0
- package/dist/core/pagination/Page.js +49 -0
- package/dist/core/pagination/exports.d.ts +1 -0
- package/dist/core/pagination/index.d.ts +1 -0
- package/dist/core/pagination/index.js +1 -0
- package/dist/core/url/encodePathParam.d.ts +3 -1
- package/dist/core/url/encodePathParam.js +8 -2
- package/dist/core/utils/index.d.ts +1 -0
- package/dist/core/utils/index.js +1 -0
- package/dist/core/utils/setObjectProperty.d.ts +12 -0
- package/dist/core/utils/setObjectProperty.js +45 -0
- package/dist/errors/ToltApiError.js +15 -1
- package/package.json +7 -2
- package/dist/api/resources/clicks/types/CreateClicksRequest.d.ts +0 -1
- package/dist/api/resources/commissions/client/requests/UpdateCommissionsRequest.js +0 -9
- package/dist/api/resources/commissions/types/ApproveCommissionsResponse.d.ts +0 -6
- package/dist/api/resources/commissions/types/CreateCommissionsRequest.d.ts +0 -1
- package/dist/api/resources/commissions/types/DeclineCommissionsResponse.d.ts +0 -6
- package/dist/api/resources/embed/exports.d.ts +0 -2
- package/dist/api/resources/embed/types/CreateTokenEmbedRequest.d.ts +0 -1
- package/dist/api/resources/embed/types/index.d.ts +0 -2
- package/dist/api/resources/embed/types/index.js +0 -2
- package/dist/api/resources/flows/types/ListFlowsRequestActive.d.ts +0 -6
- package/dist/api/resources/flows/types/ListFlowsRequestActive.js +0 -6
- package/dist/api/resources/groups/types/ListGroupsRequestDefault.d.ts +0 -6
- package/dist/api/resources/groups/types/ListGroupsRequestDefault.js +0 -6
- package/dist/api/resources/links/types/GetByParamValueLinksResponse.d.ts +0 -6
- package/dist/api/resources/transactions/types/UpdateTransactionsResponse.d.ts +0 -6
- package/dist/api/resources/transactions/types/UpdateTransactionsResponse.js +0 -2
- /package/dist/api/resources/clicks/client/requests/{GetClicksRequest.js → CreateClickRequest.js} +0 -0
- /package/dist/api/resources/clicks/{types/CreateClicksRequest.js → client/requests/GetClickRequest.js} +0 -0
- /package/dist/api/resources/clicks/types/{CreateClicksResponse.js → CreateClickResponse.js} +0 -0
- /package/dist/api/resources/clicks/types/{GetClicksResponse.js → GetClickResponse.js} +0 -0
- /package/dist/api/resources/commissions/client/requests/{ApproveCommissionsRequest.js → ApproveCommissionRequest.js} +0 -0
- /package/dist/api/resources/commissions/client/requests/{DeclineCommissionsRequest.js → DeclineCommissionRequest.js} +0 -0
- /package/dist/api/resources/commissions/client/requests/{DeleteCommissionsRequest.js → DeleteCommissionRequest.js} +0 -0
- /package/dist/api/resources/commissions/client/requests/{GetCommissionsRequest.js → GetCommissionRequest.js} +0 -0
- /package/dist/api/resources/commissions/types/{ApproveCommissionsResponse.js → ApproveCommissionResponse.js} +0 -0
- /package/dist/api/resources/commissions/types/{CreateCommissionsRequest.js → CreateCommissionResponse.js} +0 -0
- /package/dist/api/resources/commissions/types/{CreateCommissionsResponse.js → DeclineCommissionResponse.js} +0 -0
- /package/dist/api/resources/commissions/types/{DeclineCommissionsResponse.js → DeleteCommissionResponse.js} +0 -0
- /package/dist/api/resources/commissions/types/{DeleteCommissionsResponse.js → GetCommissionResponse.js} +0 -0
- /package/dist/api/resources/commissions/types/{GetCommissionsResponse.js → UpdateCommissionResponse.js} +0 -0
- /package/dist/api/resources/{commissions/types/UpdateCommissionsResponse.js → customers/client/requests/DeleteCustomerRequest.js} +0 -0
- /package/dist/api/resources/customers/client/requests/{DeleteCustomersRequest.js → GetCustomerRequest.js} +0 -0
- /package/dist/api/resources/customers/{client/requests/GetCustomersRequest.js → types/CreateCustomerResponse.js} +0 -0
- /package/dist/api/resources/customers/types/{CreateCustomersResponse.js → DeleteCustomerResponse.js} +0 -0
- /package/dist/api/resources/customers/types/{DeleteCustomersResponse.js → GetCustomerResponse.js} +0 -0
- /package/dist/api/resources/customers/types/{GetCustomersResponse.js → UpdateCustomerResponse.js} +0 -0
- /package/dist/api/resources/{customers/types/UpdateCustomersResponse.js → embedTokens/client/requests/CreateEmbedTokenRequest.js} +0 -0
- /package/dist/api/resources/{embed/client → embedTokens/client/requests}/index.js +0 -0
- /package/dist/api/resources/{embed → embedTokens}/index.d.ts +0 -0
- /package/dist/api/resources/{embed → embedTokens}/index.js +0 -0
- /package/dist/api/resources/{embed/types/CreateTokenEmbedRequest.js → embedTokens/types/CreateEmbedTokenResponse.js} +0 -0
- /package/dist/api/resources/{embed/types/CreateTokenEmbedResponse.js → flows/client/requests/GetFlowRequest.js} +0 -0
- /package/dist/api/resources/flows/{client/requests/GetFlowsRequest.js → types/GetFlowResponse.js} +0 -0
- /package/dist/api/resources/{flows/types/GetFlowsResponse.js → groups/client/requests/GetGroupRequest.js} +0 -0
- /package/dist/api/resources/groups/{client/requests/GetGroupsRequest.js → types/GetGroupResponse.js} +0 -0
- /package/dist/api/resources/{groups/types/GetGroupsResponse.js → links/client/requests/CreateLinkRequest.js} +0 -0
- /package/dist/api/resources/links/client/requests/{CreateLinksRequest.js → DeleteLinkRequest.js} +0 -0
- /package/dist/api/resources/links/client/requests/{DeleteLinksRequest.js → GetLinkByParamValueRequest.js} +0 -0
- /package/dist/api/resources/links/client/requests/{GetByParamValueLinksRequest.js → GetLinkRequest.js} +0 -0
- /package/dist/api/resources/links/client/requests/{GetLinksRequest.js → UpdateLinkRequest.js} +0 -0
- /package/dist/api/resources/links/{client/requests/UpdateLinksRequest.js → types/CreateLinkResponse.js} +0 -0
- /package/dist/api/resources/links/types/{CreateLinksResponse.js → DeleteLinkResponse.js} +0 -0
- /package/dist/api/resources/links/types/{DeleteLinksResponse.js → GetLinkByParamValueResponse.js} +0 -0
- /package/dist/api/resources/links/types/{GetByParamValueLinksResponse.js → GetLinkResponse.js} +0 -0
- /package/dist/api/resources/links/types/{GetLinksResponse.js → UpdateLinkResponse.js} +0 -0
- /package/dist/api/resources/{links/types/UpdateLinksResponse.js → partners/client/requests/ApprovePartnerRequest.js} +0 -0
- /package/dist/api/resources/partners/client/requests/{ApprovePartnersRequest.js → GetPartnerRequest.js} +0 -0
- /package/dist/api/resources/partners/client/requests/{GetPartnersRequest.js → RejectPartnerRequest.js} +0 -0
- /package/dist/api/resources/partners/client/requests/{RejectPartnersRequest.js → SuspendPartnerRequest.js} +0 -0
- /package/dist/api/resources/partners/client/requests/{SuspendPartnersRequest.js → UpdatePartnerRequest.js} +0 -0
- /package/dist/api/resources/partners/{client/requests/UpdatePartnersRequest.js → types/ApprovePartnerResponse.js} +0 -0
- /package/dist/api/resources/partners/types/{ApprovePartnersResponse.js → CreatePartnerResponse.js} +0 -0
- /package/dist/api/resources/partners/types/{CreatePartnersResponse.js → GetPartnerResponse.js} +0 -0
- /package/dist/api/resources/partners/types/{GetPartnersResponse.js → RejectPartnerResponse.js} +0 -0
- /package/dist/api/resources/partners/types/{RejectPartnersResponse.js → SuspendPartnerResponse.js} +0 -0
- /package/dist/api/resources/partners/types/{SuspendPartnersResponse.js → UpdatePartnerResponse.js} +0 -0
- /package/dist/api/resources/{partners/types/UpdatePartnersResponse.js → programs/client/requests/GetProgramRequest.js} +0 -0
- /package/dist/api/resources/programs/{client/requests/GetProgramsRequest.js → types/GetProgramResponse.js} +0 -0
- /package/dist/api/resources/{programs/types/GetProgramsResponse.js → promotionCodes/client/requests/DeletePromotionCodeRequest.js} +0 -0
- /package/dist/api/resources/promotionCodes/client/requests/{DeletePromotionCodesRequest.js → GetPromotionCodeRequest.js} +0 -0
- /package/dist/api/resources/promotionCodes/{client/requests/GetPromotionCodesRequest.js → types/CreatePromotionCodeResponse.js} +0 -0
- /package/dist/api/resources/promotionCodes/types/{CreatePromotionCodesResponse.js → DeletePromotionCodeResponse.js} +0 -0
- /package/dist/api/resources/promotionCodes/types/{DeletePromotionCodesResponse.js → GetPromotionCodeResponse.js} +0 -0
- /package/dist/api/resources/promotionCodes/types/{GetPromotionCodesResponse.js → UpdatePromotionCodeResponse.js} +0 -0
- /package/dist/api/resources/{promotionCodes/types/UpdatePromotionCodesResponse.js → reports/client/requests/ReportsCustomersRequest.js} +0 -0
- /package/dist/api/resources/reports/client/requests/{CustomerStatsReportsRequest.js → ReportsLinksRequest.js} +0 -0
- /package/dist/api/resources/reports/client/requests/{LinksReportsRequest.js → ReportsOverviewRequest.js} +0 -0
- /package/dist/api/resources/reports/client/requests/{OverviewReportsRequest.js → ReportsPartnersRequest.js} +0 -0
- /package/dist/api/resources/reports/client/requests/{PartnersReportsRequest.js → ReportsTimeseriesRequest.js} +0 -0
- /package/dist/api/resources/reports/{client/requests/TimeseriesReportsRequest.js → types/ReportsCustomersResponse.js} +0 -0
- /package/dist/api/resources/reports/types/{CustomerStatsReportsResponse.js → ReportsLinksResponse.js} +0 -0
- /package/dist/api/resources/reports/types/{LinksReportsResponse.js → ReportsOverviewResponse.js} +0 -0
- /package/dist/api/resources/reports/types/{OverviewReportsResponse.js → ReportsPartnersResponse.js} +0 -0
- /package/dist/api/resources/reports/types/{PartnersReportsResponse.js → ReportsTimeseriesResponse.js} +0 -0
- /package/dist/api/resources/{reports/types/TimeseriesReportsResponse.js → transactions/client/requests/CreateTransactionRequest.js} +0 -0
- /package/dist/api/resources/transactions/client/requests/{CreateTransactionsRequest.js → DeleteTransactionRequest.js} +0 -0
- /package/dist/api/resources/transactions/client/requests/{DeleteTransactionsRequest.js → GetTransactionRequest.js} +0 -0
- /package/dist/api/resources/transactions/client/requests/{GetTransactionsRequest.js → RefundTransactionRequest.js} +0 -0
- /package/dist/api/resources/transactions/client/requests/{RefundTransactionsRequest.js → RerunTransactionFlowsRequest.js} +0 -0
- /package/dist/api/resources/transactions/client/requests/{RerunFlowsTransactionsRequest.js → UpdateTransactionRequest.js} +0 -0
- /package/dist/api/resources/transactions/{client/requests/UpdateTransactionsRequest.js → types/CreateTransactionResponse.js} +0 -0
- /package/dist/api/resources/transactions/types/{CreateTransactionsResponse.js → DeleteTransactionResponse.js} +0 -0
- /package/dist/api/resources/transactions/types/{DeleteTransactionsResponse.js → GetTransactionResponse.js} +0 -0
- /package/dist/api/resources/transactions/types/{GetTransactionsResponse.js → RefundTransactionResponse.js} +0 -0
- /package/dist/api/resources/transactions/types/{RefundTransactionsResponse.js → RerunTransactionFlowsResponse.js} +0 -0
- /package/dist/api/resources/transactions/types/{RerunFlowsTransactionsResponse.js → UpdateTransactionResponse.js} +0 -0
- /package/dist/{api/resources/embed/client/index.d.ts → core/pagination/exports.js} +0 -0
|
@@ -159,75 +159,88 @@ export class CommissionsClient {
|
|
|
159
159
|
* @example
|
|
160
160
|
* await client.commissions.list()
|
|
161
161
|
*/
|
|
162
|
-
list(request = {}, requestOptions) {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
.
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
if (_response.error.reason === "status-code") {
|
|
208
|
-
switch (_response.error.statusCode) {
|
|
209
|
-
case 400:
|
|
210
|
-
throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
211
|
-
case 401:
|
|
212
|
-
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
213
|
-
case 413:
|
|
214
|
-
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
215
|
-
case 429:
|
|
216
|
-
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
217
|
-
default:
|
|
218
|
-
throw new errors.ToltApiError({
|
|
219
|
-
statusCode: _response.error.statusCode,
|
|
220
|
-
body: _response.error.body,
|
|
221
|
-
rawResponse: _response.rawResponse,
|
|
222
|
-
});
|
|
162
|
+
async list(request = {}, requestOptions) {
|
|
163
|
+
const list = core.HttpResponsePromise.interceptFunction(async (request) => {
|
|
164
|
+
const { limit, order, sort, starting_after: startingAfter, ending_before: endingBefore, created_after: createdAfter, created_before: createdBefore, updated_after: updatedAfter, updated_before: updatedBefore, program_id: programId, partner_id: partnerId, customer_id: customerId, transaction_id: transactionId, status, type: type_, search, } = request;
|
|
165
|
+
const _queryParams = {
|
|
166
|
+
limit,
|
|
167
|
+
order: order != null ? order : undefined,
|
|
168
|
+
sort: sort != null ? sort : undefined,
|
|
169
|
+
starting_after: startingAfter,
|
|
170
|
+
ending_before: endingBefore,
|
|
171
|
+
created_after: createdAfter != null ? createdAfter : undefined,
|
|
172
|
+
created_before: createdBefore != null ? createdBefore : undefined,
|
|
173
|
+
updated_after: updatedAfter != null ? updatedAfter : undefined,
|
|
174
|
+
updated_before: updatedBefore != null ? updatedBefore : undefined,
|
|
175
|
+
program_id: programId,
|
|
176
|
+
partner_id: partnerId,
|
|
177
|
+
customer_id: customerId,
|
|
178
|
+
transaction_id: transactionId,
|
|
179
|
+
status,
|
|
180
|
+
type: type_,
|
|
181
|
+
search,
|
|
182
|
+
};
|
|
183
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
184
|
+
const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
185
|
+
const _response = await core.fetcher({
|
|
186
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
187
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
188
|
+
environments.ToltApiEnvironment.Default, "v2/commissions"),
|
|
189
|
+
method: "GET",
|
|
190
|
+
headers: _headers,
|
|
191
|
+
queryString: core.url
|
|
192
|
+
.queryBuilder()
|
|
193
|
+
.addMany(_queryParams)
|
|
194
|
+
.mergeAdditional(requestOptions?.queryParams)
|
|
195
|
+
.build(),
|
|
196
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
197
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
198
|
+
abortSignal: requestOptions?.abortSignal,
|
|
199
|
+
fetchFn: this._options?.fetch,
|
|
200
|
+
logging: this._options.logging,
|
|
201
|
+
});
|
|
202
|
+
if (_response.ok) {
|
|
203
|
+
return {
|
|
204
|
+
data: _response.body,
|
|
205
|
+
rawResponse: _response.rawResponse,
|
|
206
|
+
};
|
|
223
207
|
}
|
|
224
|
-
|
|
225
|
-
|
|
208
|
+
if (_response.error.reason === "status-code") {
|
|
209
|
+
switch (_response.error.statusCode) {
|
|
210
|
+
case 400:
|
|
211
|
+
throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
212
|
+
case 401:
|
|
213
|
+
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
214
|
+
case 413:
|
|
215
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
216
|
+
case 429:
|
|
217
|
+
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
218
|
+
default:
|
|
219
|
+
throw new errors.ToltApiError({
|
|
220
|
+
statusCode: _response.error.statusCode,
|
|
221
|
+
body: _response.error.body,
|
|
222
|
+
rawResponse: _response.rawResponse,
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/commissions");
|
|
227
|
+
});
|
|
228
|
+
const dataWithRawResponse = await list(request).withRawResponse();
|
|
229
|
+
return new core.Page({
|
|
230
|
+
response: dataWithRawResponse.data,
|
|
231
|
+
rawResponse: dataWithRawResponse.rawResponse,
|
|
232
|
+
hasNextPage: (response) => response?.next_cursor != null &&
|
|
233
|
+
!(typeof response?.next_cursor === "string" && response?.next_cursor === ""),
|
|
234
|
+
getItems: (response) => response?.data ?? [],
|
|
235
|
+
loadPage: (response) => {
|
|
236
|
+
return list(core.setObjectProperty(request, "starting_after", response?.next_cursor));
|
|
237
|
+
},
|
|
238
|
+
});
|
|
226
239
|
}
|
|
227
240
|
/**
|
|
228
241
|
* Supports historical created_at values. Status defaults to approved when omitted.
|
|
229
242
|
*
|
|
230
|
-
* @param {ToltApi.
|
|
243
|
+
* @param {ToltApi.CreateCommissionRequest} request
|
|
231
244
|
* @param {CommissionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
232
245
|
*
|
|
233
246
|
* @throws {@link ToltApi.BadRequestError}
|
|
@@ -240,7 +253,12 @@ export class CommissionsClient {
|
|
|
240
253
|
*
|
|
241
254
|
* @example
|
|
242
255
|
* await client.commissions.create({
|
|
243
|
-
*
|
|
256
|
+
* amount: 1000,
|
|
257
|
+
* customer_id: "cus_LBfjvtfct9pVUeLojMHiGnXv",
|
|
258
|
+
* revenue: 5000,
|
|
259
|
+
* status: "approved",
|
|
260
|
+
* source: "api",
|
|
261
|
+
* transaction_id: "txn_fB3egT1sKNVNu3ZYuU1ypYDA"
|
|
244
262
|
* })
|
|
245
263
|
*/
|
|
246
264
|
create(request, requestOptions) {
|
|
@@ -260,7 +278,7 @@ export class CommissionsClient {
|
|
|
260
278
|
requestType: "json",
|
|
261
279
|
body: mergeAdditionalBodyParameters(request, requestOptions?.additionalBodyParameters),
|
|
262
280
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
263
|
-
maxRetries:
|
|
281
|
+
maxRetries: 0,
|
|
264
282
|
abortSignal: requestOptions?.abortSignal,
|
|
265
283
|
fetchFn: this._options?.fetch,
|
|
266
284
|
logging: this._options.logging,
|
|
@@ -293,7 +311,7 @@ export class CommissionsClient {
|
|
|
293
311
|
/**
|
|
294
312
|
* Gets a commission by ID, with its amount, status, type and partner, plus its customer and transaction when it has them.
|
|
295
313
|
*
|
|
296
|
-
* @param {ToltApi.
|
|
314
|
+
* @param {ToltApi.GetCommissionRequest} request
|
|
297
315
|
* @param {CommissionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
298
316
|
*
|
|
299
317
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
@@ -318,7 +336,7 @@ export class CommissionsClient {
|
|
|
318
336
|
const _response = await core.fetcher({
|
|
319
337
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
320
338
|
(await core.Supplier.get(this._options.environment)) ??
|
|
321
|
-
environments.ToltApiEnvironment.Default, `v2/commissions/${core.url.encodePathParam(id)}`),
|
|
339
|
+
environments.ToltApiEnvironment.Default, `v2/commissions/${core.url.encodePathParam(id, errors.ToltApiError)}`),
|
|
322
340
|
method: "GET",
|
|
323
341
|
headers: _headers,
|
|
324
342
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
@@ -354,7 +372,7 @@ export class CommissionsClient {
|
|
|
354
372
|
/**
|
|
355
373
|
* Unpaid commissions can be changed unless linked to a confirmed invoice or legacy autopayout invoice. Affected draft invoice totals are recalculated.
|
|
356
374
|
*
|
|
357
|
-
* @param {ToltApi.
|
|
375
|
+
* @param {ToltApi.UpdateCommissionRequest} request
|
|
358
376
|
* @param {CommissionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
359
377
|
*
|
|
360
378
|
* @throws {@link ToltApi.BadRequestError}
|
|
@@ -384,7 +402,7 @@ export class CommissionsClient {
|
|
|
384
402
|
const _response = await core.fetcher({
|
|
385
403
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
386
404
|
(await core.Supplier.get(this._options.environment)) ??
|
|
387
|
-
environments.ToltApiEnvironment.Default, `v2/commissions/${core.url.encodePathParam(id)}`),
|
|
405
|
+
environments.ToltApiEnvironment.Default, `v2/commissions/${core.url.encodePathParam(id, errors.ToltApiError)}`),
|
|
388
406
|
method: "PUT",
|
|
389
407
|
headers: _headers,
|
|
390
408
|
contentType: "application/json",
|
|
@@ -427,7 +445,7 @@ export class CommissionsClient {
|
|
|
427
445
|
/**
|
|
428
446
|
* Deletes a commission. Fails for paid commissions, refund commissions, commissions on a refunded transaction, and those on a confirmed or legacy autopayout invoice.
|
|
429
447
|
*
|
|
430
|
-
* @param {ToltApi.
|
|
448
|
+
* @param {ToltApi.DeleteCommissionRequest} request
|
|
431
449
|
* @param {CommissionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
432
450
|
*
|
|
433
451
|
* @throws {@link ToltApi.BadRequestError}
|
|
@@ -454,7 +472,7 @@ export class CommissionsClient {
|
|
|
454
472
|
const _response = await core.fetcher({
|
|
455
473
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
456
474
|
(await core.Supplier.get(this._options.environment)) ??
|
|
457
|
-
environments.ToltApiEnvironment.Default, `v2/commissions/${core.url.encodePathParam(id)}`),
|
|
475
|
+
environments.ToltApiEnvironment.Default, `v2/commissions/${core.url.encodePathParam(id, errors.ToltApiError)}`),
|
|
458
476
|
method: "DELETE",
|
|
459
477
|
headers: _headers,
|
|
460
478
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
@@ -494,7 +512,7 @@ export class CommissionsClient {
|
|
|
494
512
|
/**
|
|
495
513
|
* Marks a commission approved so it is included in the next payout. Fails for paid commissions, refund commissions, commissions on a refunded transaction, and those on a confirmed or legacy autopayout invoice.
|
|
496
514
|
*
|
|
497
|
-
* @param {ToltApi.
|
|
515
|
+
* @param {ToltApi.ApproveCommissionRequest} request
|
|
498
516
|
* @param {CommissionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
499
517
|
*
|
|
500
518
|
* @throws {@link ToltApi.BadRequestError}
|
|
@@ -521,7 +539,7 @@ export class CommissionsClient {
|
|
|
521
539
|
const _response = await core.fetcher({
|
|
522
540
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
523
541
|
(await core.Supplier.get(this._options.environment)) ??
|
|
524
|
-
environments.ToltApiEnvironment.Default, `v2/commissions/${core.url.encodePathParam(id)}/approve`),
|
|
542
|
+
environments.ToltApiEnvironment.Default, `v2/commissions/${core.url.encodePathParam(id, errors.ToltApiError)}/approve`),
|
|
525
543
|
method: "POST",
|
|
526
544
|
headers: _headers,
|
|
527
545
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
@@ -561,7 +579,7 @@ export class CommissionsClient {
|
|
|
561
579
|
/**
|
|
562
580
|
* Marks a commission declined so it is left out of payouts until it is approved again. Fails for paid commissions, refund commissions, commissions on a refunded transaction, and those on a confirmed or legacy autopayout invoice.
|
|
563
581
|
*
|
|
564
|
-
* @param {ToltApi.
|
|
582
|
+
* @param {ToltApi.DeclineCommissionRequest} request
|
|
565
583
|
* @param {CommissionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
566
584
|
*
|
|
567
585
|
* @throws {@link ToltApi.BadRequestError}
|
|
@@ -588,7 +606,7 @@ export class CommissionsClient {
|
|
|
588
606
|
const _response = await core.fetcher({
|
|
589
607
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
590
608
|
(await core.Supplier.get(this._options.environment)) ??
|
|
591
|
-
environments.ToltApiEnvironment.Default, `v2/commissions/${core.url.encodePathParam(id)}/decline`),
|
|
609
|
+
environments.ToltApiEnvironment.Default, `v2/commissions/${core.url.encodePathParam(id, errors.ToltApiError)}/decline`),
|
|
592
610
|
method: "POST",
|
|
593
611
|
headers: _headers,
|
|
594
612
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* amount: 1000,
|
|
5
|
+
* customer_id: "cus_LBfjvtfct9pVUeLojMHiGnXv",
|
|
6
|
+
* revenue: 5000,
|
|
7
|
+
* status: "approved",
|
|
8
|
+
* source: "api",
|
|
9
|
+
* transaction_id: "txn_fB3egT1sKNVNu3ZYuU1ypYDA"
|
|
10
|
+
* }
|
|
11
|
+
*/
|
|
12
|
+
export interface CreateCommissionRequest {
|
|
13
|
+
/** When the commission was earned, as a timestamp with a time zone, for example 2026-03-01T12:00:00Z. Reports and filters by creation date place the commission on this date; the upcoming approvals forecast goes by its scheduled approval date, which this does not change. Defaults to now. */
|
|
14
|
+
created_at?: string;
|
|
15
|
+
/** What the partner earns for this commission, in minor units of the program currency (cents for USD). */
|
|
16
|
+
amount: number;
|
|
17
|
+
/** Id of the customer the commission is for (cus_...), as returned when listing customers. The commission goes to the customer's partner and program; partner_id and program_id can be left out, and when given they must match the customer's. */
|
|
18
|
+
customer_id?: string;
|
|
19
|
+
/** Id of the partner who earns the commission (part_...), as returned when listing partners. Used with program_id when no customer_id is given. */
|
|
20
|
+
partner_id?: string;
|
|
21
|
+
/** Id of the partner's program (prg_...). Required with partner_id when no customer_id is given. */
|
|
22
|
+
program_id?: string;
|
|
23
|
+
/** The sale amount the commission is based on, in minor units of the program currency. */
|
|
24
|
+
revenue?: number;
|
|
25
|
+
status?: CreateCommissionRequest.Status;
|
|
26
|
+
/** Free-form label for where the commission came from, such as stripe or api. */
|
|
27
|
+
source?: string;
|
|
28
|
+
/** Id of the payment in your billing system that the commission is for, such as a Stripe charge id. */
|
|
29
|
+
charge_id?: string;
|
|
30
|
+
/** Id of the transaction the commission is for (txn_...). It must belong to the commission's customer, or to its partner and program, and must not be refunded. */
|
|
31
|
+
transaction_id?: string;
|
|
32
|
+
}
|
|
33
|
+
export declare namespace CreateCommissionRequest {
|
|
34
|
+
const Status: {
|
|
35
|
+
readonly Pending: "pending";
|
|
36
|
+
readonly Approved: "approved";
|
|
37
|
+
readonly Rejected: "rejected";
|
|
38
|
+
};
|
|
39
|
+
type Status = (typeof Status)[keyof typeof Status];
|
|
40
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var CreateCommissionRequest;
|
|
3
|
+
(function (CreateCommissionRequest) {
|
|
4
|
+
CreateCommissionRequest.Status = {
|
|
5
|
+
Pending: "pending",
|
|
6
|
+
Approved: "approved",
|
|
7
|
+
Rejected: "rejected",
|
|
8
|
+
};
|
|
9
|
+
})(CreateCommissionRequest || (CreateCommissionRequest = {}));
|
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
* status: "approved"
|
|
8
8
|
* }
|
|
9
9
|
*/
|
|
10
|
-
export interface
|
|
10
|
+
export interface UpdateCommissionRequest {
|
|
11
11
|
id: string;
|
|
12
12
|
/** What the partner earns for this commission, in minor units of the program currency (cents for USD). */
|
|
13
13
|
amount?: number;
|
|
14
14
|
/** The sale amount the commission is based on, in minor units of the program currency. */
|
|
15
15
|
revenue?: number;
|
|
16
|
-
status?:
|
|
16
|
+
status?: UpdateCommissionRequest.Status;
|
|
17
17
|
/** Free-form label for where the commission came from, such as stripe or api. */
|
|
18
18
|
source?: string | null;
|
|
19
19
|
/** Id of the payment in your billing system that the commission is for, such as a Stripe charge id. */
|
|
@@ -23,7 +23,7 @@ export interface UpdateCommissionsRequest {
|
|
|
23
23
|
/** When the commission was earned, as a timestamp with a time zone, for example 2026-03-01T12:00:00Z. Reports and filters by creation date place the commission on this date; the upcoming approvals forecast goes by its scheduled approval date, which this does not change. */
|
|
24
24
|
created_at?: string;
|
|
25
25
|
}
|
|
26
|
-
export declare namespace
|
|
26
|
+
export declare namespace UpdateCommissionRequest {
|
|
27
27
|
const Status: {
|
|
28
28
|
readonly Pending: "pending";
|
|
29
29
|
readonly Approved: "approved";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var UpdateCommissionRequest;
|
|
3
|
+
(function (UpdateCommissionRequest) {
|
|
4
|
+
UpdateCommissionRequest.Status = {
|
|
5
|
+
Pending: "pending",
|
|
6
|
+
Approved: "approved",
|
|
7
|
+
Rejected: "rejected",
|
|
8
|
+
};
|
|
9
|
+
})(UpdateCommissionRequest || (UpdateCommissionRequest = {}));
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export type {
|
|
1
|
+
export type { ApproveCommissionRequest } from "./ApproveCommissionRequest.js";
|
|
2
2
|
export type { BulkApproveCommissionsRequest } from "./BulkApproveCommissionsRequest.js";
|
|
3
3
|
export type { BulkDeclineCommissionsRequest } from "./BulkDeclineCommissionsRequest.js";
|
|
4
|
-
export
|
|
5
|
-
export type {
|
|
6
|
-
export type {
|
|
4
|
+
export { CreateCommissionRequest } from "./CreateCommissionRequest.js";
|
|
5
|
+
export type { DeclineCommissionRequest } from "./DeclineCommissionRequest.js";
|
|
6
|
+
export type { DeleteCommissionRequest } from "./DeleteCommissionRequest.js";
|
|
7
|
+
export type { GetCommissionRequest } from "./GetCommissionRequest.js";
|
|
7
8
|
export type { ListCommissionsRequest } from "./ListCommissionsRequest.js";
|
|
8
|
-
export {
|
|
9
|
+
export { UpdateCommissionRequest } from "./UpdateCommissionRequest.js";
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { CreateCommissionRequest } from "./CreateCommissionRequest.js";
|
|
2
|
+
export { UpdateCommissionRequest } from "./UpdateCommissionRequest.js";
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./ApproveCommissionResponse.js";
|
|
2
2
|
export * from "./BulkApproveCommissionsResponse.js";
|
|
3
3
|
export * from "./BulkDeclineCommissionsResponse.js";
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./
|
|
6
|
-
export * from "./
|
|
7
|
-
export * from "./
|
|
8
|
-
export * from "./GetCommissionsResponse.js";
|
|
4
|
+
export * from "./CreateCommissionResponse.js";
|
|
5
|
+
export * from "./DeclineCommissionResponse.js";
|
|
6
|
+
export * from "./DeleteCommissionResponse.js";
|
|
7
|
+
export * from "./GetCommissionResponse.js";
|
|
9
8
|
export * from "./ListCommissionsRequestOrder.js";
|
|
10
9
|
export * from "./ListCommissionsRequestSort.js";
|
|
11
10
|
export * from "./ListCommissionsResponse.js";
|
|
12
|
-
export * from "./
|
|
11
|
+
export * from "./UpdateCommissionResponse.js";
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./ApproveCommissionResponse.js";
|
|
2
2
|
export * from "./BulkApproveCommissionsResponse.js";
|
|
3
3
|
export * from "./BulkDeclineCommissionsResponse.js";
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./
|
|
6
|
-
export * from "./
|
|
7
|
-
export * from "./
|
|
8
|
-
export * from "./GetCommissionsResponse.js";
|
|
4
|
+
export * from "./CreateCommissionResponse.js";
|
|
5
|
+
export * from "./DeclineCommissionResponse.js";
|
|
6
|
+
export * from "./DeleteCommissionResponse.js";
|
|
7
|
+
export * from "./GetCommissionResponse.js";
|
|
9
8
|
export * from "./ListCommissionsRequestOrder.js";
|
|
10
9
|
export * from "./ListCommissionsRequestSort.js";
|
|
11
10
|
export * from "./ListCommissionsResponse.js";
|
|
12
|
-
export * from "./
|
|
11
|
+
export * from "./UpdateCommissionResponse.js";
|
|
@@ -26,12 +26,11 @@ export declare class CustomersClient {
|
|
|
26
26
|
* @example
|
|
27
27
|
* await client.customers.list()
|
|
28
28
|
*/
|
|
29
|
-
list(request?: ToltApi.ListCustomersRequest, requestOptions?: CustomersClient.RequestOptions): core.
|
|
30
|
-
private __list;
|
|
29
|
+
list(request?: ToltApi.ListCustomersRequest, requestOptions?: CustomersClient.RequestOptions): Promise<core.Page<ToltApi.Customer, ToltApi.ListCustomersResponse>>;
|
|
31
30
|
/**
|
|
32
31
|
* Creates a customer attributed to a partner. Pass partner_id or link_id, and optionally the click_id that brought them in.
|
|
33
32
|
*
|
|
34
|
-
* @param {ToltApi.
|
|
33
|
+
* @param {ToltApi.CreateCustomerRequest} request
|
|
35
34
|
* @param {CustomersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
36
35
|
*
|
|
37
36
|
* @throws {@link ToltApi.BadRequestError}
|
|
@@ -51,12 +50,12 @@ export declare class CustomersClient {
|
|
|
51
50
|
* partner_id: "part_NLYzgNKuSuASvrvoxNtau6SY"
|
|
52
51
|
* })
|
|
53
52
|
*/
|
|
54
|
-
create(request?: ToltApi.
|
|
53
|
+
create(request?: ToltApi.CreateCustomerRequest, requestOptions?: CustomersClient.RequestOptions): core.HttpResponsePromise<ToltApi.CreateCustomerResponse>;
|
|
55
54
|
private __create;
|
|
56
55
|
/**
|
|
57
56
|
* Gets a customer by ID, with its status, the partner it is attributed to and your own customer and subscription IDs.
|
|
58
57
|
*
|
|
59
|
-
* @param {ToltApi.
|
|
58
|
+
* @param {ToltApi.GetCustomerRequest} request
|
|
60
59
|
* @param {CustomersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
61
60
|
*
|
|
62
61
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
@@ -71,12 +70,12 @@ export declare class CustomersClient {
|
|
|
71
70
|
* id: "cus_LBfjvtfct9pVUeLojMHiGnXv"
|
|
72
71
|
* })
|
|
73
72
|
*/
|
|
74
|
-
get(request: ToltApi.
|
|
73
|
+
get(request: ToltApi.GetCustomerRequest, requestOptions?: CustomersClient.RequestOptions): core.HttpResponsePromise<ToltApi.GetCustomerResponse>;
|
|
75
74
|
private __get;
|
|
76
75
|
/**
|
|
77
76
|
* Updates a customer's name, email, status, your own IDs, or the click and link the customer came from.
|
|
78
77
|
*
|
|
79
|
-
* @param {ToltApi.
|
|
78
|
+
* @param {ToltApi.UpdateCustomerRequest} request
|
|
80
79
|
* @param {CustomersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
81
80
|
*
|
|
82
81
|
* @throws {@link ToltApi.BadRequestError}
|
|
@@ -95,12 +94,12 @@ export declare class CustomersClient {
|
|
|
95
94
|
* status: "active"
|
|
96
95
|
* })
|
|
97
96
|
*/
|
|
98
|
-
update(request: ToltApi.
|
|
97
|
+
update(request: ToltApi.UpdateCustomerRequest, requestOptions?: CustomersClient.RequestOptions): core.HttpResponsePromise<ToltApi.UpdateCustomerResponse>;
|
|
99
98
|
private __update;
|
|
100
99
|
/**
|
|
101
100
|
* Deletes a customer. Fails when any of the customer's commissions is paid or already included in a payout.
|
|
102
101
|
*
|
|
103
|
-
* @param {ToltApi.
|
|
102
|
+
* @param {ToltApi.DeleteCustomerRequest} request
|
|
104
103
|
* @param {CustomersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
105
104
|
*
|
|
106
105
|
* @throws {@link ToltApi.BadRequestError}
|
|
@@ -116,6 +115,6 @@ export declare class CustomersClient {
|
|
|
116
115
|
* id: "cus_LBfjvtfct9pVUeLojMHiGnXv"
|
|
117
116
|
* })
|
|
118
117
|
*/
|
|
119
|
-
delete(request: ToltApi.
|
|
118
|
+
delete(request: ToltApi.DeleteCustomerRequest, requestOptions?: CustomersClient.RequestOptions): core.HttpResponsePromise<ToltApi.DeleteCustomerResponse>;
|
|
120
119
|
private __delete;
|
|
121
120
|
}
|