@tolt/api 0.6.1 → 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 +7 -0
- package/dist/api/errors/ContentTooLargeError.js +17 -0
- 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/errors/index.d.ts +1 -0
- package/dist/api/errors/index.js +1 -0
- package/dist/api/resources/clicks/client/Client.d.ts +16 -8
- package/dist/api/resources/clicks/client/Client.js +93 -68
- package/dist/api/resources/clicks/client/requests/CreateClickRequest.d.ts +28 -0
- package/dist/api/resources/clicks/client/requests/GetClickRequest.d.ts +9 -0
- package/dist/api/resources/clicks/client/requests/ListClicksRequest.d.ts +10 -5
- 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/ListClicksRequestOrder.d.ts +1 -0
- package/dist/api/resources/clicks/types/ListClicksRequestOrder.js +1 -0
- package/dist/api/resources/clicks/types/ListClicksRequestSort.d.ts +1 -1
- package/dist/api/resources/clicks/types/ListClicksRequestSort.js +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 +48 -22
- package/dist/api/resources/commissions/client/Client.js +142 -84
- package/dist/api/resources/commissions/client/requests/ApproveCommissionRequest.d.ts +9 -0
- package/dist/api/resources/commissions/client/requests/BulkApproveCommissionsRequest.d.ts +2 -2
- package/dist/api/resources/commissions/client/requests/BulkDeclineCommissionsRequest.d.ts +2 -2
- 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/DeclineCommissionRequest.d.ts +9 -0
- package/dist/api/resources/commissions/client/requests/DeleteCommissionRequest.d.ts +9 -0
- package/dist/api/resources/commissions/client/requests/GetCommissionRequest.d.ts +9 -0
- package/dist/api/resources/commissions/client/requests/ListCommissionsRequest.d.ts +14 -5
- package/dist/api/resources/commissions/client/requests/UpdateCommissionRequest.d.ts +33 -0
- 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/ListCommissionsRequestOrder.d.ts +1 -0
- package/dist/api/resources/commissions/types/ListCommissionsRequestOrder.js +1 -0
- package/dist/api/resources/commissions/types/ListCommissionsRequestSort.d.ts +1 -1
- package/dist/api/resources/commissions/types/ListCommissionsRequestSort.js +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 +36 -14
- package/dist/api/resources/customers/client/Client.js +120 -74
- package/dist/api/resources/customers/client/requests/CreateCustomerRequest.d.ts +47 -0
- package/dist/api/resources/customers/client/requests/CreateCustomerRequest.js +12 -0
- package/dist/api/resources/customers/client/requests/DeleteCustomerRequest.d.ts +9 -0
- package/dist/api/resources/customers/client/requests/GetCustomerRequest.d.ts +9 -0
- package/dist/api/resources/customers/client/requests/ListCustomersRequest.d.ts +14 -5
- package/dist/api/resources/customers/client/requests/UpdateCustomerRequest.d.ts +44 -0
- package/dist/api/resources/customers/client/requests/UpdateCustomerRequest.js +12 -0
- 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/ListCustomersRequestOrder.d.ts +1 -0
- package/dist/api/resources/customers/types/ListCustomersRequestOrder.js +1 -0
- package/dist/api/resources/customers/types/ListCustomersRequestSort.d.ts +1 -1
- package/dist/api/resources/customers/types/ListCustomersRequestSort.js +1 -1
- package/dist/api/resources/customers/types/ListCustomersRequestStatus.d.ts +1 -0
- package/dist/api/resources/customers/types/ListCustomersRequestStatus.js +1 -0
- 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 +10 -9
- package/dist/api/resources/{embed → embedTokens}/client/Client.js +11 -8
- 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 +10 -5
- package/dist/api/resources/flows/client/Client.js +83 -63
- package/dist/api/resources/flows/client/requests/GetFlowRequest.d.ts +9 -0
- package/dist/api/resources/flows/client/requests/ListFlowsRequest.d.ts +14 -6
- 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/ListFlowsRequestOrder.d.ts +1 -0
- package/dist/api/resources/flows/types/ListFlowsRequestOrder.js +1 -0
- package/dist/api/resources/flows/types/ListFlowsRequestSort.d.ts +1 -1
- package/dist/api/resources/flows/types/ListFlowsRequestSort.js +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 +10 -5
- package/dist/api/resources/groups/client/Client.js +80 -60
- package/dist/api/resources/groups/client/requests/GetGroupRequest.d.ts +9 -0
- package/dist/api/resources/groups/client/requests/ListGroupsRequest.d.ts +11 -6
- 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/ListGroupsRequestOrder.d.ts +1 -0
- package/dist/api/resources/groups/types/ListGroupsRequestOrder.js +1 -0
- package/dist/api/resources/groups/types/ListGroupsRequestSort.d.ts +1 -1
- package/dist/api/resources/groups/types/ListGroupsRequestSort.js +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 -3
- package/dist/api/resources/index.js +3 -3
- package/dist/api/resources/links/client/Client.d.ts +28 -17
- package/dist/api/resources/links/client/Client.js +111 -75
- package/dist/api/resources/links/client/requests/CreateLinkRequest.d.ts +16 -0
- package/dist/api/resources/links/client/requests/DeleteLinkRequest.d.ts +9 -0
- package/dist/api/resources/links/client/requests/{GetByParamValueLinksRequest.d.ts → GetLinkByParamValueRequest.d.ts} +1 -1
- package/dist/api/resources/links/client/requests/GetLinkRequest.d.ts +9 -0
- package/dist/api/resources/links/client/requests/ListLinksRequest.d.ts +12 -5
- package/dist/api/resources/links/client/requests/UpdateLinkRequest.d.ts +15 -0
- 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/ListLinksRequestOrder.d.ts +1 -0
- package/dist/api/resources/links/types/ListLinksRequestOrder.js +1 -0
- package/dist/api/resources/links/types/ListLinksRequestSort.d.ts +1 -1
- package/dist/api/resources/links/types/ListLinksRequestSort.js +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 +52 -24
- package/dist/api/resources/partners/client/Client.js +140 -85
- package/dist/api/resources/partners/client/requests/ApprovePartnerRequest.d.ts +9 -0
- package/dist/api/resources/partners/client/requests/BulkApprovePartnersRequest.d.ts +2 -2
- package/dist/api/resources/partners/client/requests/BulkRejectPartnersRequest.d.ts +4 -2
- package/dist/api/resources/partners/client/requests/CreatePartnerRequest.d.ts +59 -0
- package/dist/api/resources/partners/client/requests/CreatePartnerRequest.js +9 -0
- package/dist/api/resources/partners/client/requests/GetPartnerRequest.d.ts +9 -0
- package/dist/api/resources/partners/client/requests/ListPartnersRequest.d.ts +11 -5
- package/dist/api/resources/partners/client/requests/RejectPartnerRequest.d.ts +11 -0
- package/dist/api/resources/partners/client/requests/SuspendPartnerRequest.d.ts +11 -0
- package/dist/api/resources/partners/client/requests/UpdatePartnerRequest.d.ts +24 -0
- 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/ListPartnersRequestOrder.d.ts +1 -0
- package/dist/api/resources/partners/types/ListPartnersRequestOrder.js +1 -0
- package/dist/api/resources/partners/types/ListPartnersRequestSort.d.ts +1 -1
- package/dist/api/resources/partners/types/ListPartnersRequestSort.js +1 -1
- package/dist/api/resources/partners/types/ListPartnersRequestStatus.d.ts +1 -0
- package/dist/api/resources/partners/types/ListPartnersRequestStatus.js +1 -0
- 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 +10 -5
- package/dist/api/resources/programs/client/Client.js +78 -58
- package/dist/api/resources/programs/client/requests/GetProgramRequest.d.ts +9 -0
- package/dist/api/resources/programs/client/requests/ListProgramsRequest.d.ts +8 -5
- 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/ListProgramsRequestOrder.d.ts +1 -0
- package/dist/api/resources/programs/types/ListProgramsRequestOrder.js +1 -0
- package/dist/api/resources/programs/types/ListProgramsRequestSort.d.ts +1 -1
- package/dist/api/resources/programs/types/ListProgramsRequestSort.js +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 +36 -15
- package/dist/api/resources/promotionCodes/client/Client.js +121 -72
- package/dist/api/resources/promotionCodes/client/requests/CreatePromotionCodeRequest.d.ts +27 -0
- package/dist/api/resources/promotionCodes/client/requests/CreatePromotionCodeRequest.js +9 -0
- package/dist/api/resources/promotionCodes/client/requests/DeletePromotionCodeRequest.d.ts +9 -0
- package/dist/api/resources/promotionCodes/client/requests/GetPromotionCodeRequest.d.ts +9 -0
- package/dist/api/resources/promotionCodes/client/requests/ListPromotionCodesRequest.d.ts +11 -5
- package/dist/api/resources/promotionCodes/client/requests/UpdatePromotionCodeRequest.d.ts +26 -0
- package/dist/api/resources/promotionCodes/client/requests/UpdatePromotionCodeRequest.js +9 -0
- 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/ListPromotionCodesRequestOrder.d.ts +1 -0
- package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestOrder.js +1 -0
- package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestSort.d.ts +1 -1
- package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestSort.js +1 -1
- package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestType.d.ts +1 -0
- package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestType.js +1 -0
- 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 +27 -14
- package/dist/api/resources/reports/client/Client.js +182 -118
- package/dist/api/resources/reports/client/requests/ReportsCustomersRequest.d.ts +12 -0
- package/dist/api/resources/reports/client/requests/ReportsLinksRequest.d.ts +23 -0
- package/dist/api/resources/reports/client/requests/ReportsOverviewRequest.d.ts +12 -0
- package/dist/api/resources/reports/client/requests/ReportsPartnersRequest.d.ts +23 -0
- package/dist/api/resources/reports/client/requests/ReportsTimeseriesRequest.d.ts +17 -0
- package/dist/api/resources/reports/client/requests/index.d.ts +5 -5
- package/dist/api/resources/reports/types/LinksReportsRequestOrder.d.ts +1 -0
- package/dist/api/resources/reports/types/LinksReportsRequestOrder.js +1 -0
- package/dist/api/resources/reports/types/LinksReportsRequestSort.d.ts +1 -0
- package/dist/api/resources/reports/types/LinksReportsRequestSort.js +1 -0
- package/dist/api/resources/reports/types/PartnersReportsRequestOrder.d.ts +1 -0
- package/dist/api/resources/reports/types/PartnersReportsRequestOrder.js +1 -0
- package/dist/api/resources/reports/types/PartnersReportsRequestSort.d.ts +1 -0
- package/dist/api/resources/reports/types/PartnersReportsRequestSort.js +1 -0
- 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/TimeseriesReportsRequestGranularity.d.ts +1 -0
- package/dist/api/resources/reports/types/TimeseriesReportsRequestGranularity.js +1 -0
- 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 +43 -21
- package/dist/api/resources/transactions/client/Client.js +132 -80
- package/dist/api/resources/transactions/client/requests/CreateTransactionRequest.d.ts +34 -0
- package/dist/api/resources/transactions/client/requests/DeleteTransactionRequest.d.ts +9 -0
- package/dist/api/resources/transactions/client/requests/GetTransactionRequest.d.ts +9 -0
- package/dist/api/resources/transactions/client/requests/ListTransactionsRequest.d.ts +12 -5
- package/dist/api/resources/transactions/client/requests/RefundTransactionRequest.d.ts +9 -0
- package/dist/api/resources/transactions/client/requests/RerunTransactionFlowsRequest.d.ts +9 -0
- package/dist/api/resources/transactions/client/requests/UpdateTransactionRequest.d.ts +31 -0
- 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/ListTransactionsRequestOrder.d.ts +1 -0
- package/dist/api/resources/transactions/types/ListTransactionsRequestOrder.js +1 -0
- package/dist/api/resources/transactions/types/ListTransactionsRequestSort.d.ts +1 -1
- package/dist/api/resources/transactions/types/ListTransactionsRequestSort.js +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/Commission.d.ts +1 -1
- package/dist/api/types/Customer.d.ts +2 -2
- package/dist/api/types/{Error_.d.ts → ErrorResponse.d.ts} +5 -4
- package/dist/api/types/{Error_.js → ErrorResponse.js} +5 -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/exports.js +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/environments.d.ts +2 -2
- package/dist/environments.js +1 -1
- package/dist/errors/ToltApiError.js +15 -1
- package/package.json +7 -2
- package/dist/api/resources/clicks/client/requests/GetClicksRequest.d.ts +0 -9
- package/dist/api/resources/clicks/types/CreateClicksRequest.d.ts +0 -1
- package/dist/api/resources/commissions/client/requests/ApproveCommissionsRequest.d.ts +0 -9
- package/dist/api/resources/commissions/client/requests/DeclineCommissionsRequest.d.ts +0 -9
- package/dist/api/resources/commissions/client/requests/DeleteCommissionsRequest.d.ts +0 -9
- package/dist/api/resources/commissions/client/requests/GetCommissionsRequest.d.ts +0 -9
- package/dist/api/resources/commissions/client/requests/UpdateCommissionsRequest.d.ts +0 -18
- 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/customers/client/requests/CreateCustomersRequest.d.ts +0 -29
- package/dist/api/resources/customers/client/requests/CreateCustomersRequest.js +0 -11
- package/dist/api/resources/customers/client/requests/DeleteCustomersRequest.d.ts +0 -9
- package/dist/api/resources/customers/client/requests/GetCustomersRequest.d.ts +0 -9
- package/dist/api/resources/customers/client/requests/UpdateCustomersRequest.d.ts +0 -31
- package/dist/api/resources/customers/client/requests/UpdateCustomersRequest.js +0 -11
- package/dist/api/resources/embed/client/requests/CreateTokenEmbedRequest.d.ts +0 -14
- package/dist/api/resources/embed/client/requests/index.d.ts +0 -1
- package/dist/api/resources/embed/exports.d.ts +0 -2
- package/dist/api/resources/embed/types/index.d.ts +0 -1
- package/dist/api/resources/embed/types/index.js +0 -1
- package/dist/api/resources/flows/client/requests/GetFlowsRequest.d.ts +0 -9
- package/dist/api/resources/flows/types/ListFlowsRequestActive.d.ts +0 -5
- package/dist/api/resources/flows/types/ListFlowsRequestActive.js +0 -5
- package/dist/api/resources/groups/client/requests/GetGroupsRequest.d.ts +0 -9
- package/dist/api/resources/groups/types/ListGroupsRequestDefault.d.ts +0 -5
- package/dist/api/resources/groups/types/ListGroupsRequestDefault.js +0 -5
- package/dist/api/resources/links/client/requests/CreateLinksRequest.d.ts +0 -12
- package/dist/api/resources/links/client/requests/DeleteLinksRequest.d.ts +0 -9
- package/dist/api/resources/links/client/requests/GetLinksRequest.d.ts +0 -9
- package/dist/api/resources/links/client/requests/UpdateLinksRequest.d.ts +0 -11
- package/dist/api/resources/links/types/GetByParamValueLinksResponse.d.ts +0 -6
- package/dist/api/resources/partners/client/requests/ApprovePartnersRequest.d.ts +0 -9
- package/dist/api/resources/partners/client/requests/CreatePartnersRequest.d.ts +0 -45
- package/dist/api/resources/partners/client/requests/CreatePartnersRequest.js +0 -8
- package/dist/api/resources/partners/client/requests/GetPartnersRequest.d.ts +0 -9
- package/dist/api/resources/partners/client/requests/RejectPartnersRequest.d.ts +0 -10
- package/dist/api/resources/partners/client/requests/SuspendPartnersRequest.d.ts +0 -10
- package/dist/api/resources/partners/client/requests/UpdatePartnersRequest.d.ts +0 -16
- package/dist/api/resources/programs/client/requests/GetProgramsRequest.d.ts +0 -9
- package/dist/api/resources/promotionCodes/client/requests/CreatePromotionCodesRequest.d.ts +0 -20
- package/dist/api/resources/promotionCodes/client/requests/CreatePromotionCodesRequest.js +0 -8
- package/dist/api/resources/promotionCodes/client/requests/DeletePromotionCodesRequest.d.ts +0 -9
- package/dist/api/resources/promotionCodes/client/requests/GetPromotionCodesRequest.d.ts +0 -9
- package/dist/api/resources/promotionCodes/client/requests/UpdatePromotionCodesRequest.d.ts +0 -19
- package/dist/api/resources/promotionCodes/client/requests/UpdatePromotionCodesRequest.js +0 -8
- package/dist/api/resources/reports/client/requests/CustomerStatsReportsRequest.d.ts +0 -9
- package/dist/api/resources/reports/client/requests/LinksReportsRequest.d.ts +0 -15
- package/dist/api/resources/reports/client/requests/OverviewReportsRequest.d.ts +0 -9
- package/dist/api/resources/reports/client/requests/PartnersReportsRequest.d.ts +0 -15
- package/dist/api/resources/reports/client/requests/TimeseriesReportsRequest.d.ts +0 -12
- package/dist/api/resources/transactions/client/requests/CreateTransactionsRequest.d.ts +0 -20
- package/dist/api/resources/transactions/client/requests/DeleteTransactionsRequest.d.ts +0 -9
- package/dist/api/resources/transactions/client/requests/GetTransactionsRequest.d.ts +0 -9
- package/dist/api/resources/transactions/client/requests/RefundTransactionsRequest.d.ts +0 -9
- package/dist/api/resources/transactions/client/requests/RerunFlowsTransactionsRequest.d.ts +0 -9
- package/dist/api/resources/transactions/client/requests/UpdateTransactionsRequest.d.ts +0 -20
- package/dist/api/resources/transactions/types/RerunFlowsTransactionsResponse.js +0 -2
- 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/{client/requests/UpdateCommissionsRequest.js → types/ApproveCommissionResponse.js} +0 -0
- /package/dist/api/resources/commissions/types/{ApproveCommissionsResponse.js → CreateCommissionResponse.js} +0 -0
- /package/dist/api/resources/commissions/types/{CreateCommissionsRequest.js → DeclineCommissionResponse.js} +0 -0
- /package/dist/api/resources/commissions/types/{CreateCommissionsResponse.js → DeleteCommissionResponse.js} +0 -0
- /package/dist/api/resources/commissions/types/{DeclineCommissionsResponse.js → GetCommissionResponse.js} +0 -0
- /package/dist/api/resources/commissions/types/{DeleteCommissionsResponse.js → UpdateCommissionResponse.js} +0 -0
- /package/dist/api/resources/{commissions/types/GetCommissionsResponse.js → customers/client/requests/DeleteCustomerRequest.js} +0 -0
- /package/dist/api/resources/{commissions/types/UpdateCommissionsResponse.js → customers/client/requests/GetCustomerRequest.js} +0 -0
- /package/dist/api/resources/customers/{client/requests/DeleteCustomersRequest.js → types/CreateCustomerResponse.js} +0 -0
- /package/dist/api/resources/customers/{client/requests/GetCustomersRequest.js → types/DeleteCustomerResponse.js} +0 -0
- /package/dist/api/resources/customers/types/{CreateCustomersResponse.js → GetCustomerResponse.js} +0 -0
- /package/dist/api/resources/customers/types/{DeleteCustomersResponse.js → UpdateCustomerResponse.js} +0 -0
- /package/dist/api/resources/{embed → embedTokens}/client/index.d.ts +0 -0
- /package/dist/api/resources/{embed → embedTokens}/client/index.js +0 -0
- /package/dist/api/resources/{customers/types/GetCustomersResponse.js → embedTokens/client/requests/CreateEmbedTokenRequest.js} +0 -0
- /package/dist/api/resources/{embed → 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/{customers/types/UpdateCustomersResponse.js → embedTokens/types/CreateEmbedTokenResponse.js} +0 -0
- /package/dist/api/resources/{embed/client/requests/CreateTokenEmbedRequest.js → flows/client/requests/GetFlowRequest.js} +0 -0
- /package/dist/api/resources/{embed/types/CreateTokenEmbedResponse.js → flows/types/GetFlowResponse.js} +0 -0
- /package/dist/api/resources/{flows/client/requests/GetFlowsRequest.js → groups/client/requests/GetGroupRequest.js} +0 -0
- /package/dist/api/resources/{flows/types/GetFlowsResponse.js → groups/types/GetGroupResponse.js} +0 -0
- /package/dist/api/resources/{groups/client/requests/GetGroupsRequest.js → links/client/requests/CreateLinkRequest.js} +0 -0
- /package/dist/api/resources/{groups/types/GetGroupsResponse.js → links/client/requests/DeleteLinkRequest.js} +0 -0
- /package/dist/api/resources/links/client/requests/{CreateLinksRequest.js → GetLinkByParamValueRequest.js} +0 -0
- /package/dist/api/resources/links/client/requests/{DeleteLinksRequest.js → GetLinkRequest.js} +0 -0
- /package/dist/api/resources/links/client/requests/{GetByParamValueLinksRequest.js → UpdateLinkRequest.js} +0 -0
- /package/dist/api/resources/links/{client/requests/GetLinksRequest.js → types/CreateLinkResponse.js} +0 -0
- /package/dist/api/resources/links/{client/requests/UpdateLinksRequest.js → types/DeleteLinkResponse.js} +0 -0
- /package/dist/api/resources/links/types/{CreateLinksResponse.js → GetLinkByParamValueResponse.js} +0 -0
- /package/dist/api/resources/links/types/{DeleteLinksResponse.js → GetLinkResponse.js} +0 -0
- /package/dist/api/resources/links/types/{GetByParamValueLinksResponse.js → UpdateLinkResponse.js} +0 -0
- /package/dist/api/resources/{links/types/GetLinksResponse.js → partners/client/requests/ApprovePartnerRequest.js} +0 -0
- /package/dist/api/resources/{links/types/UpdateLinksResponse.js → partners/client/requests/GetPartnerRequest.js} +0 -0
- /package/dist/api/resources/partners/client/requests/{ApprovePartnersRequest.js → RejectPartnerRequest.js} +0 -0
- /package/dist/api/resources/partners/client/requests/{GetPartnersRequest.js → SuspendPartnerRequest.js} +0 -0
- /package/dist/api/resources/partners/client/requests/{RejectPartnersRequest.js → UpdatePartnerRequest.js} +0 -0
- /package/dist/api/resources/partners/{client/requests/SuspendPartnersRequest.js → types/ApprovePartnerResponse.js} +0 -0
- /package/dist/api/resources/partners/{client/requests/UpdatePartnersRequest.js → types/CreatePartnerResponse.js} +0 -0
- /package/dist/api/resources/partners/types/{ApprovePartnersResponse.js → GetPartnerResponse.js} +0 -0
- /package/dist/api/resources/partners/types/{CreatePartnersResponse.js → RejectPartnerResponse.js} +0 -0
- /package/dist/api/resources/partners/types/{GetPartnersResponse.js → SuspendPartnerResponse.js} +0 -0
- /package/dist/api/resources/partners/types/{RejectPartnersResponse.js → UpdatePartnerResponse.js} +0 -0
- /package/dist/api/resources/{partners/types/SuspendPartnersResponse.js → programs/client/requests/GetProgramRequest.js} +0 -0
- /package/dist/api/resources/{partners/types/UpdatePartnersResponse.js → programs/types/GetProgramResponse.js} +0 -0
- /package/dist/api/resources/{programs/client/requests/GetProgramsRequest.js → promotionCodes/client/requests/DeletePromotionCodeRequest.js} +0 -0
- /package/dist/api/resources/{programs/types/GetProgramsResponse.js → promotionCodes/client/requests/GetPromotionCodeRequest.js} +0 -0
- /package/dist/api/resources/promotionCodes/{client/requests/DeletePromotionCodesRequest.js → types/CreatePromotionCodeResponse.js} +0 -0
- /package/dist/api/resources/promotionCodes/{client/requests/GetPromotionCodesRequest.js → types/DeletePromotionCodeResponse.js} +0 -0
- /package/dist/api/resources/promotionCodes/types/{CreatePromotionCodesResponse.js → GetPromotionCodeResponse.js} +0 -0
- /package/dist/api/resources/promotionCodes/types/{DeletePromotionCodesResponse.js → UpdatePromotionCodeResponse.js} +0 -0
- /package/dist/api/resources/{promotionCodes/types/GetPromotionCodesResponse.js → reports/client/requests/ReportsCustomersRequest.js} +0 -0
- /package/dist/api/resources/{promotionCodes/types/UpdatePromotionCodesResponse.js → reports/client/requests/ReportsLinksRequest.js} +0 -0
- /package/dist/api/resources/reports/client/requests/{CustomerStatsReportsRequest.js → ReportsOverviewRequest.js} +0 -0
- /package/dist/api/resources/reports/client/requests/{LinksReportsRequest.js → ReportsPartnersRequest.js} +0 -0
- /package/dist/api/resources/reports/client/requests/{OverviewReportsRequest.js → ReportsTimeseriesRequest.js} +0 -0
- /package/dist/api/resources/reports/{client/requests/PartnersReportsRequest.js → types/ReportsCustomersResponse.js} +0 -0
- /package/dist/api/resources/reports/{client/requests/TimeseriesReportsRequest.js → types/ReportsLinksResponse.js} +0 -0
- /package/dist/api/resources/reports/types/{CustomerStatsReportsResponse.js → ReportsOverviewResponse.js} +0 -0
- /package/dist/api/resources/reports/types/{LinksReportsResponse.js → ReportsPartnersResponse.js} +0 -0
- /package/dist/api/resources/reports/types/{OverviewReportsResponse.js → ReportsTimeseriesResponse.js} +0 -0
- /package/dist/api/resources/{reports/types/PartnersReportsResponse.js → transactions/client/requests/CreateTransactionRequest.js} +0 -0
- /package/dist/api/resources/{reports/types/TimeseriesReportsResponse.js → transactions/client/requests/DeleteTransactionRequest.js} +0 -0
- /package/dist/api/resources/transactions/client/requests/{CreateTransactionsRequest.js → GetTransactionRequest.js} +0 -0
- /package/dist/api/resources/transactions/client/requests/{DeleteTransactionsRequest.js → RefundTransactionRequest.js} +0 -0
- /package/dist/api/resources/transactions/client/requests/{GetTransactionsRequest.js → RerunTransactionFlowsRequest.js} +0 -0
- /package/dist/api/resources/transactions/client/requests/{RefundTransactionsRequest.js → UpdateTransactionRequest.js} +0 -0
- /package/dist/api/resources/transactions/{client/requests/RerunFlowsTransactionsRequest.js → types/CreateTransactionResponse.js} +0 -0
- /package/dist/api/resources/transactions/{client/requests/UpdateTransactionsRequest.js → types/DeleteTransactionResponse.js} +0 -0
- /package/dist/api/resources/transactions/types/{CreateTransactionsResponse.js → GetTransactionResponse.js} +0 -0
- /package/dist/api/resources/transactions/types/{DeleteTransactionsResponse.js → RefundTransactionResponse.js} +0 -0
- /package/dist/api/resources/transactions/types/{GetTransactionsResponse.js → RerunTransactionFlowsResponse.js} +0 -0
- /package/dist/api/resources/transactions/types/{RefundTransactionsResponse.js → UpdateTransactionResponse.js} +0 -0
|
@@ -11,11 +11,14 @@ export declare class PromotionCodesClient {
|
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<PromotionCodesClient.Options>;
|
|
12
12
|
constructor(options: PromotionCodesClient.Options);
|
|
13
13
|
/**
|
|
14
|
+
* Lists promotion codes. Filter by program, partner or type, and page with cursors.
|
|
15
|
+
*
|
|
14
16
|
* @param {ToltApi.ListPromotionCodesRequest} request
|
|
15
17
|
* @param {PromotionCodesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
16
18
|
*
|
|
17
19
|
* @throws {@link ToltApi.BadRequestError}
|
|
18
20
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
21
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
19
22
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
20
23
|
* @throws {@link errors.ToltApiError}
|
|
21
24
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
@@ -23,76 +26,94 @@ export declare class PromotionCodesClient {
|
|
|
23
26
|
* @example
|
|
24
27
|
* await client.promotionCodes.list()
|
|
25
28
|
*/
|
|
26
|
-
list(request?: ToltApi.ListPromotionCodesRequest, requestOptions?: PromotionCodesClient.RequestOptions): core.
|
|
27
|
-
private __list;
|
|
29
|
+
list(request?: ToltApi.ListPromotionCodesRequest, requestOptions?: PromotionCodesClient.RequestOptions): Promise<core.Page<ToltApi.PromotionCode, ToltApi.ListPromotionCodesResponse>>;
|
|
28
30
|
/**
|
|
29
|
-
*
|
|
31
|
+
* Creates a promotion code for a partner, so customers who use it are credited to them. A partner cannot have the same code twice.
|
|
32
|
+
*
|
|
33
|
+
* @param {ToltApi.CreatePromotionCodeRequest} request
|
|
30
34
|
* @param {PromotionCodesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
31
35
|
*
|
|
32
36
|
* @throws {@link ToltApi.BadRequestError}
|
|
33
37
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
38
|
+
* @throws {@link ToltApi.ConflictError}
|
|
39
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
34
40
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
35
41
|
* @throws {@link errors.ToltApiError}
|
|
36
42
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
37
43
|
*
|
|
38
44
|
* @example
|
|
39
45
|
* await client.promotionCodes.create({
|
|
40
|
-
* code: "
|
|
41
|
-
*
|
|
46
|
+
* code: "SAM20",
|
|
47
|
+
* type: "percentage",
|
|
48
|
+
* value: "20",
|
|
49
|
+
* partner_id: "part_NLYzgNKuSuASvrvoxNtau6SY"
|
|
42
50
|
* })
|
|
43
51
|
*/
|
|
44
|
-
create(request: ToltApi.
|
|
52
|
+
create(request: ToltApi.CreatePromotionCodeRequest, requestOptions?: PromotionCodesClient.RequestOptions): core.HttpResponsePromise<ToltApi.CreatePromotionCodeResponse>;
|
|
45
53
|
private __create;
|
|
46
54
|
/**
|
|
47
|
-
*
|
|
55
|
+
* Gets a promotion code by ID, with its discount type and value and the partner, group or program it belongs to.
|
|
56
|
+
*
|
|
57
|
+
* @param {ToltApi.GetPromotionCodeRequest} request
|
|
48
58
|
* @param {PromotionCodesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
49
59
|
*
|
|
50
60
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
51
61
|
* @throws {@link ToltApi.NotFoundError}
|
|
62
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
52
63
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
53
64
|
* @throws {@link errors.ToltApiError}
|
|
54
65
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
55
66
|
*
|
|
56
67
|
* @example
|
|
57
68
|
* await client.promotionCodes.get({
|
|
58
|
-
* id: "
|
|
69
|
+
* id: "promo_gTCAUsWfdmN2GuCVRaHWNRan"
|
|
59
70
|
* })
|
|
60
71
|
*/
|
|
61
|
-
get(request: ToltApi.
|
|
72
|
+
get(request: ToltApi.GetPromotionCodeRequest, requestOptions?: PromotionCodesClient.RequestOptions): core.HttpResponsePromise<ToltApi.GetPromotionCodeResponse>;
|
|
62
73
|
private __get;
|
|
63
74
|
/**
|
|
64
|
-
*
|
|
75
|
+
* Updates a promotion code's code, discount type or value.
|
|
76
|
+
*
|
|
77
|
+
* @param {ToltApi.UpdatePromotionCodeRequest} request
|
|
65
78
|
* @param {PromotionCodesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
66
79
|
*
|
|
67
80
|
* @throws {@link ToltApi.BadRequestError}
|
|
68
81
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
69
82
|
* @throws {@link ToltApi.NotFoundError}
|
|
83
|
+
* @throws {@link ToltApi.ConflictError}
|
|
84
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
70
85
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
71
86
|
* @throws {@link errors.ToltApiError}
|
|
72
87
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
73
88
|
*
|
|
74
89
|
* @example
|
|
75
90
|
* await client.promotionCodes.update({
|
|
76
|
-
* id: "
|
|
91
|
+
* id: "promo_gTCAUsWfdmN2GuCVRaHWNRan",
|
|
92
|
+
* code: "SAM20",
|
|
93
|
+
* type: "percentage",
|
|
94
|
+
* value: "20"
|
|
77
95
|
* })
|
|
78
96
|
*/
|
|
79
|
-
update(request: ToltApi.
|
|
97
|
+
update(request: ToltApi.UpdatePromotionCodeRequest, requestOptions?: PromotionCodesClient.RequestOptions): core.HttpResponsePromise<ToltApi.UpdatePromotionCodeResponse>;
|
|
80
98
|
private __update;
|
|
81
99
|
/**
|
|
82
|
-
*
|
|
100
|
+
* Deletes a promotion code, so customers who use it afterwards are no longer attributed through it.
|
|
101
|
+
*
|
|
102
|
+
* @param {ToltApi.DeletePromotionCodeRequest} request
|
|
83
103
|
* @param {PromotionCodesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
84
104
|
*
|
|
85
105
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
86
106
|
* @throws {@link ToltApi.NotFoundError}
|
|
107
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
87
108
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
88
109
|
* @throws {@link errors.ToltApiError}
|
|
89
110
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
90
111
|
*
|
|
91
112
|
* @example
|
|
92
113
|
* await client.promotionCodes.delete({
|
|
93
|
-
* id: "
|
|
114
|
+
* id: "promo_gTCAUsWfdmN2GuCVRaHWNRan"
|
|
94
115
|
* })
|
|
95
116
|
*/
|
|
96
|
-
delete(request: ToltApi.
|
|
117
|
+
delete(request: ToltApi.DeletePromotionCodeRequest, requestOptions?: PromotionCodesClient.RequestOptions): core.HttpResponsePromise<ToltApi.DeletePromotionCodeResponse>;
|
|
97
118
|
private __delete;
|
|
98
119
|
}
|
|
@@ -12,11 +12,14 @@ export class PromotionCodesClient {
|
|
|
12
12
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
|
+
* Lists promotion codes. Filter by program, partner or type, and page with cursors.
|
|
16
|
+
*
|
|
15
17
|
* @param {ToltApi.ListPromotionCodesRequest} request
|
|
16
18
|
* @param {PromotionCodesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
17
19
|
*
|
|
18
20
|
* @throws {@link ToltApi.BadRequestError}
|
|
19
21
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
22
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
20
23
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
21
24
|
* @throws {@link errors.ToltApiError}
|
|
22
25
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
@@ -24,80 +27,101 @@ export class PromotionCodesClient {
|
|
|
24
27
|
* @example
|
|
25
28
|
* await client.promotionCodes.list()
|
|
26
29
|
*/
|
|
27
|
-
list(request = {}, requestOptions) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
if (_response.error.reason === "status-code") {
|
|
70
|
-
switch (_response.error.statusCode) {
|
|
71
|
-
case 400:
|
|
72
|
-
throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
73
|
-
case 401:
|
|
74
|
-
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
75
|
-
case 429:
|
|
76
|
-
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
77
|
-
default:
|
|
78
|
-
throw new errors.ToltApiError({
|
|
79
|
-
statusCode: _response.error.statusCode,
|
|
80
|
-
body: _response.error.body,
|
|
81
|
-
rawResponse: _response.rawResponse,
|
|
82
|
-
});
|
|
30
|
+
async list(request = {}, requestOptions) {
|
|
31
|
+
const list = core.HttpResponsePromise.interceptFunction(async (request) => {
|
|
32
|
+
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, type: type_, search, } = request;
|
|
33
|
+
const _queryParams = {
|
|
34
|
+
limit,
|
|
35
|
+
order: order != null ? order : undefined,
|
|
36
|
+
sort: sort != null ? sort : undefined,
|
|
37
|
+
starting_after: startingAfter,
|
|
38
|
+
ending_before: endingBefore,
|
|
39
|
+
created_after: createdAfter != null ? createdAfter : undefined,
|
|
40
|
+
created_before: createdBefore != null ? createdBefore : undefined,
|
|
41
|
+
updated_after: updatedAfter != null ? updatedAfter : undefined,
|
|
42
|
+
updated_before: updatedBefore != null ? updatedBefore : undefined,
|
|
43
|
+
program_id: programId,
|
|
44
|
+
partner_id: partnerId,
|
|
45
|
+
type: type_ != null ? type_ : undefined,
|
|
46
|
+
search,
|
|
47
|
+
};
|
|
48
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
49
|
+
const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
50
|
+
const _response = await core.fetcher({
|
|
51
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
52
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
53
|
+
environments.ToltApiEnvironment.Default, "v2/promotion-codes"),
|
|
54
|
+
method: "GET",
|
|
55
|
+
headers: _headers,
|
|
56
|
+
queryString: core.url
|
|
57
|
+
.queryBuilder()
|
|
58
|
+
.addMany(_queryParams)
|
|
59
|
+
.mergeAdditional(requestOptions?.queryParams)
|
|
60
|
+
.build(),
|
|
61
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
62
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
63
|
+
abortSignal: requestOptions?.abortSignal,
|
|
64
|
+
fetchFn: this._options?.fetch,
|
|
65
|
+
logging: this._options.logging,
|
|
66
|
+
});
|
|
67
|
+
if (_response.ok) {
|
|
68
|
+
return {
|
|
69
|
+
data: _response.body,
|
|
70
|
+
rawResponse: _response.rawResponse,
|
|
71
|
+
};
|
|
83
72
|
}
|
|
84
|
-
|
|
85
|
-
|
|
73
|
+
if (_response.error.reason === "status-code") {
|
|
74
|
+
switch (_response.error.statusCode) {
|
|
75
|
+
case 400:
|
|
76
|
+
throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
77
|
+
case 401:
|
|
78
|
+
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
79
|
+
case 413:
|
|
80
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
81
|
+
case 429:
|
|
82
|
+
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
83
|
+
default:
|
|
84
|
+
throw new errors.ToltApiError({
|
|
85
|
+
statusCode: _response.error.statusCode,
|
|
86
|
+
body: _response.error.body,
|
|
87
|
+
rawResponse: _response.rawResponse,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/promotion-codes");
|
|
92
|
+
});
|
|
93
|
+
const dataWithRawResponse = await list(request).withRawResponse();
|
|
94
|
+
return new core.Page({
|
|
95
|
+
response: dataWithRawResponse.data,
|
|
96
|
+
rawResponse: dataWithRawResponse.rawResponse,
|
|
97
|
+
hasNextPage: (response) => response?.next_cursor != null &&
|
|
98
|
+
!(typeof response?.next_cursor === "string" && response?.next_cursor === ""),
|
|
99
|
+
getItems: (response) => response?.data ?? [],
|
|
100
|
+
loadPage: (response) => {
|
|
101
|
+
return list(core.setObjectProperty(request, "starting_after", response?.next_cursor));
|
|
102
|
+
},
|
|
103
|
+
});
|
|
86
104
|
}
|
|
87
105
|
/**
|
|
88
|
-
*
|
|
106
|
+
* Creates a promotion code for a partner, so customers who use it are credited to them. A partner cannot have the same code twice.
|
|
107
|
+
*
|
|
108
|
+
* @param {ToltApi.CreatePromotionCodeRequest} request
|
|
89
109
|
* @param {PromotionCodesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
90
110
|
*
|
|
91
111
|
* @throws {@link ToltApi.BadRequestError}
|
|
92
112
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
113
|
+
* @throws {@link ToltApi.ConflictError}
|
|
114
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
93
115
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
94
116
|
* @throws {@link errors.ToltApiError}
|
|
95
117
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
96
118
|
*
|
|
97
119
|
* @example
|
|
98
120
|
* await client.promotionCodes.create({
|
|
99
|
-
* code: "
|
|
100
|
-
*
|
|
121
|
+
* code: "SAM20",
|
|
122
|
+
* type: "percentage",
|
|
123
|
+
* value: "20",
|
|
124
|
+
* partner_id: "part_NLYzgNKuSuASvrvoxNtau6SY"
|
|
101
125
|
* })
|
|
102
126
|
*/
|
|
103
127
|
create(request, requestOptions) {
|
|
@@ -109,7 +133,7 @@ export class PromotionCodesClient {
|
|
|
109
133
|
const _response = await core.fetcher({
|
|
110
134
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
111
135
|
(await core.Supplier.get(this._options.environment)) ??
|
|
112
|
-
environments.ToltApiEnvironment.
|
|
136
|
+
environments.ToltApiEnvironment.Default, "v2/promotion-codes"),
|
|
113
137
|
method: "POST",
|
|
114
138
|
headers: _headers,
|
|
115
139
|
contentType: "application/json",
|
|
@@ -117,7 +141,7 @@ export class PromotionCodesClient {
|
|
|
117
141
|
requestType: "json",
|
|
118
142
|
body: mergeAdditionalBodyParameters(request, requestOptions?.additionalBodyParameters),
|
|
119
143
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
120
|
-
maxRetries:
|
|
144
|
+
maxRetries: 0,
|
|
121
145
|
abortSignal: requestOptions?.abortSignal,
|
|
122
146
|
fetchFn: this._options?.fetch,
|
|
123
147
|
logging: this._options.logging,
|
|
@@ -131,6 +155,10 @@ export class PromotionCodesClient {
|
|
|
131
155
|
throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
132
156
|
case 401:
|
|
133
157
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
158
|
+
case 409:
|
|
159
|
+
throw new ToltApi.ConflictError(_response.error.body, _response.rawResponse);
|
|
160
|
+
case 413:
|
|
161
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
134
162
|
case 429:
|
|
135
163
|
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
136
164
|
default:
|
|
@@ -144,18 +172,21 @@ export class PromotionCodesClient {
|
|
|
144
172
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/promotion-codes");
|
|
145
173
|
}
|
|
146
174
|
/**
|
|
147
|
-
*
|
|
175
|
+
* Gets a promotion code by ID, with its discount type and value and the partner, group or program it belongs to.
|
|
176
|
+
*
|
|
177
|
+
* @param {ToltApi.GetPromotionCodeRequest} request
|
|
148
178
|
* @param {PromotionCodesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
149
179
|
*
|
|
150
180
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
151
181
|
* @throws {@link ToltApi.NotFoundError}
|
|
182
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
152
183
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
153
184
|
* @throws {@link errors.ToltApiError}
|
|
154
185
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
155
186
|
*
|
|
156
187
|
* @example
|
|
157
188
|
* await client.promotionCodes.get({
|
|
158
|
-
* id: "
|
|
189
|
+
* id: "promo_gTCAUsWfdmN2GuCVRaHWNRan"
|
|
159
190
|
* })
|
|
160
191
|
*/
|
|
161
192
|
get(request, requestOptions) {
|
|
@@ -168,7 +199,7 @@ export class PromotionCodesClient {
|
|
|
168
199
|
const _response = await core.fetcher({
|
|
169
200
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
170
201
|
(await core.Supplier.get(this._options.environment)) ??
|
|
171
|
-
environments.ToltApiEnvironment.
|
|
202
|
+
environments.ToltApiEnvironment.Default, `v2/promotion-codes/${core.url.encodePathParam(id, errors.ToltApiError)}`),
|
|
172
203
|
method: "GET",
|
|
173
204
|
headers: _headers,
|
|
174
205
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
@@ -187,6 +218,8 @@ export class PromotionCodesClient {
|
|
|
187
218
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
188
219
|
case 404:
|
|
189
220
|
throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
221
|
+
case 413:
|
|
222
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
190
223
|
case 429:
|
|
191
224
|
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
192
225
|
default:
|
|
@@ -200,19 +233,26 @@ export class PromotionCodesClient {
|
|
|
200
233
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/promotion-codes/{id}");
|
|
201
234
|
}
|
|
202
235
|
/**
|
|
203
|
-
*
|
|
236
|
+
* Updates a promotion code's code, discount type or value.
|
|
237
|
+
*
|
|
238
|
+
* @param {ToltApi.UpdatePromotionCodeRequest} request
|
|
204
239
|
* @param {PromotionCodesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
205
240
|
*
|
|
206
241
|
* @throws {@link ToltApi.BadRequestError}
|
|
207
242
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
208
243
|
* @throws {@link ToltApi.NotFoundError}
|
|
244
|
+
* @throws {@link ToltApi.ConflictError}
|
|
245
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
209
246
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
210
247
|
* @throws {@link errors.ToltApiError}
|
|
211
248
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
212
249
|
*
|
|
213
250
|
* @example
|
|
214
251
|
* await client.promotionCodes.update({
|
|
215
|
-
* id: "
|
|
252
|
+
* id: "promo_gTCAUsWfdmN2GuCVRaHWNRan",
|
|
253
|
+
* code: "SAM20",
|
|
254
|
+
* type: "percentage",
|
|
255
|
+
* value: "20"
|
|
216
256
|
* })
|
|
217
257
|
*/
|
|
218
258
|
update(request, requestOptions) {
|
|
@@ -225,7 +265,7 @@ export class PromotionCodesClient {
|
|
|
225
265
|
const _response = await core.fetcher({
|
|
226
266
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
227
267
|
(await core.Supplier.get(this._options.environment)) ??
|
|
228
|
-
environments.ToltApiEnvironment.
|
|
268
|
+
environments.ToltApiEnvironment.Default, `v2/promotion-codes/${core.url.encodePathParam(id, errors.ToltApiError)}`),
|
|
229
269
|
method: "PUT",
|
|
230
270
|
headers: _headers,
|
|
231
271
|
contentType: "application/json",
|
|
@@ -249,6 +289,10 @@ export class PromotionCodesClient {
|
|
|
249
289
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
250
290
|
case 404:
|
|
251
291
|
throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
292
|
+
case 409:
|
|
293
|
+
throw new ToltApi.ConflictError(_response.error.body, _response.rawResponse);
|
|
294
|
+
case 413:
|
|
295
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
252
296
|
case 429:
|
|
253
297
|
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
254
298
|
default:
|
|
@@ -262,18 +306,21 @@ export class PromotionCodesClient {
|
|
|
262
306
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v2/promotion-codes/{id}");
|
|
263
307
|
}
|
|
264
308
|
/**
|
|
265
|
-
*
|
|
309
|
+
* Deletes a promotion code, so customers who use it afterwards are no longer attributed through it.
|
|
310
|
+
*
|
|
311
|
+
* @param {ToltApi.DeletePromotionCodeRequest} request
|
|
266
312
|
* @param {PromotionCodesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
267
313
|
*
|
|
268
314
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
269
315
|
* @throws {@link ToltApi.NotFoundError}
|
|
316
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
270
317
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
271
318
|
* @throws {@link errors.ToltApiError}
|
|
272
319
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
273
320
|
*
|
|
274
321
|
* @example
|
|
275
322
|
* await client.promotionCodes.delete({
|
|
276
|
-
* id: "
|
|
323
|
+
* id: "promo_gTCAUsWfdmN2GuCVRaHWNRan"
|
|
277
324
|
* })
|
|
278
325
|
*/
|
|
279
326
|
delete(request, requestOptions) {
|
|
@@ -286,7 +333,7 @@ export class PromotionCodesClient {
|
|
|
286
333
|
const _response = await core.fetcher({
|
|
287
334
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
288
335
|
(await core.Supplier.get(this._options.environment)) ??
|
|
289
|
-
environments.ToltApiEnvironment.
|
|
336
|
+
environments.ToltApiEnvironment.Default, `v2/promotion-codes/${core.url.encodePathParam(id, errors.ToltApiError)}`),
|
|
290
337
|
method: "DELETE",
|
|
291
338
|
headers: _headers,
|
|
292
339
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
@@ -305,6 +352,8 @@ export class PromotionCodesClient {
|
|
|
305
352
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
306
353
|
case 404:
|
|
307
354
|
throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
355
|
+
case 413:
|
|
356
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
308
357
|
case 429:
|
|
309
358
|
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
310
359
|
default:
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* code: "SAM20",
|
|
5
|
+
* type: "percentage",
|
|
6
|
+
* value: "20",
|
|
7
|
+
* partner_id: "part_NLYzgNKuSuASvrvoxNtau6SY"
|
|
8
|
+
* }
|
|
9
|
+
*/
|
|
10
|
+
export interface CreatePromotionCodeRequest {
|
|
11
|
+
/** The discount code as customers enter it at checkout. Customers and payments that use it are attributed to the code's partner. A partner cannot have the same code twice, ignoring case. Recording it here does not create it in your billing system. */
|
|
12
|
+
code: string;
|
|
13
|
+
/** Whether value is a percent off or a fixed amount off. */
|
|
14
|
+
type?: CreatePromotionCodeRequest.Type;
|
|
15
|
+
/** Size of the discount as a plain decimal: a percent from 0 to 100 for percentage codes ("20" is 20%), or an amount from 0 to 1,000,000 in major units of the program currency for fixed codes ("20" is 20.00). */
|
|
16
|
+
value?: string;
|
|
17
|
+
/** Id of the partner the code belongs to (part_...), as returned when listing partners. The code is created in that partner's program. */
|
|
18
|
+
partner_id: string;
|
|
19
|
+
}
|
|
20
|
+
export declare namespace CreatePromotionCodeRequest {
|
|
21
|
+
/** Whether value is a percent off or a fixed amount off. */
|
|
22
|
+
const Type: {
|
|
23
|
+
readonly Fixed: "fixed";
|
|
24
|
+
readonly Percentage: "percentage";
|
|
25
|
+
};
|
|
26
|
+
type Type = (typeof Type)[keyof typeof Type];
|
|
27
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var CreatePromotionCodeRequest;
|
|
3
|
+
(function (CreatePromotionCodeRequest) {
|
|
4
|
+
/** Whether value is a percent off or a fixed amount off. */
|
|
5
|
+
CreatePromotionCodeRequest.Type = {
|
|
6
|
+
Fixed: "fixed",
|
|
7
|
+
Percentage: "percentage",
|
|
8
|
+
};
|
|
9
|
+
})(CreatePromotionCodeRequest || (CreatePromotionCodeRequest = {}));
|
|
@@ -4,24 +4,30 @@ import type * as ToltApi from "../../../../index.js";
|
|
|
4
4
|
* {}
|
|
5
5
|
*/
|
|
6
6
|
export interface ListPromotionCodesRequest {
|
|
7
|
+
/** How many rows to return in one page. */
|
|
7
8
|
limit?: number;
|
|
9
|
+
/** Ranking direction: desc puts the most recently created or updated rows first. */
|
|
8
10
|
order?: ToltApi.ListPromotionCodesRequestOrder;
|
|
9
|
-
/**
|
|
11
|
+
/** Timestamp to order and page by: created_at follows creation order, updated_at follows each item's most recent change. */
|
|
10
12
|
sort?: ToltApi.ListPromotionCodesRequestSort;
|
|
11
13
|
/** Continue after a position: the next_cursor of a previous page, or an item id when sorting by created_at. Cannot be combined with ending_before. */
|
|
12
14
|
starting_after?: string;
|
|
13
15
|
/** Page backward from a position: the prev_cursor of a previous page, or an item id when sorting by created_at. Cannot be combined with starting_after. */
|
|
14
16
|
ending_before?: string;
|
|
15
|
-
/**
|
|
17
|
+
/** Start of a window on when items were created: items created at this time or later are included, for example 2026-01-01T00:00:00Z. Leave it out for no lower bound. */
|
|
16
18
|
created_after?: string;
|
|
17
|
-
/**
|
|
19
|
+
/** End of a window on when items were created: only items created before this time are included. Leave it out for no upper bound. */
|
|
18
20
|
created_before?: string;
|
|
19
|
-
/** Only items
|
|
21
|
+
/** Only items last changed at or after this moment; with sort=updated_at, use it to fetch what changed since a previous sync. */
|
|
20
22
|
updated_after?: string;
|
|
21
|
-
/** Only items
|
|
23
|
+
/** Only items last changed before this moment; pair it with updated_after to fetch what changed in a period. */
|
|
22
24
|
updated_before?: string;
|
|
25
|
+
/** Limit to one program, by its id (prg_...) as returned when listing programs. */
|
|
23
26
|
program_id?: string;
|
|
27
|
+
/** Limit to one partner, by its id (part_...) as returned when listing partners. */
|
|
24
28
|
partner_id?: string;
|
|
29
|
+
/** Only codes giving this kind of discount: a fixed amount off or a percentage off. */
|
|
25
30
|
type?: ToltApi.ListPromotionCodesRequestType;
|
|
31
|
+
/** Text matched anywhere in the code, ignoring case. */
|
|
26
32
|
search?: string;
|
|
27
33
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* id: "promo_gTCAUsWfdmN2GuCVRaHWNRan",
|
|
5
|
+
* code: "SAM20",
|
|
6
|
+
* type: "percentage",
|
|
7
|
+
* value: "20"
|
|
8
|
+
* }
|
|
9
|
+
*/
|
|
10
|
+
export interface UpdatePromotionCodeRequest {
|
|
11
|
+
id: string;
|
|
12
|
+
/** The discount code as customers enter it at checkout. Customers and payments that use it are attributed to the code's partner. A partner cannot have the same code twice, ignoring case. */
|
|
13
|
+
code?: string;
|
|
14
|
+
/** Whether value is a percent off or a fixed amount off. */
|
|
15
|
+
type?: UpdatePromotionCodeRequest.Type | null;
|
|
16
|
+
/** Size of the discount as a plain decimal: a percent from 0 to 100 for percentage codes ("20" is 20%), or an amount from 0 to 1,000,000 in major units of the program currency for fixed codes ("20" is 20.00). null clears it. */
|
|
17
|
+
value?: string | null;
|
|
18
|
+
}
|
|
19
|
+
export declare namespace UpdatePromotionCodeRequest {
|
|
20
|
+
/** Whether value is a percent off or a fixed amount off. */
|
|
21
|
+
const Type: {
|
|
22
|
+
readonly Fixed: "fixed";
|
|
23
|
+
readonly Percentage: "percentage";
|
|
24
|
+
};
|
|
25
|
+
type Type = (typeof Type)[keyof typeof Type];
|
|
26
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var UpdatePromotionCodeRequest;
|
|
3
|
+
(function (UpdatePromotionCodeRequest) {
|
|
4
|
+
/** Whether value is a percent off or a fixed amount off. */
|
|
5
|
+
UpdatePromotionCodeRequest.Type = {
|
|
6
|
+
Fixed: "fixed",
|
|
7
|
+
Percentage: "percentage",
|
|
8
|
+
};
|
|
9
|
+
})(UpdatePromotionCodeRequest || (UpdatePromotionCodeRequest = {}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type {
|
|
3
|
-
export type {
|
|
1
|
+
export { CreatePromotionCodeRequest } from "./CreatePromotionCodeRequest.js";
|
|
2
|
+
export type { DeletePromotionCodeRequest } from "./DeletePromotionCodeRequest.js";
|
|
3
|
+
export type { GetPromotionCodeRequest } from "./GetPromotionCodeRequest.js";
|
|
4
4
|
export type { ListPromotionCodesRequest } from "./ListPromotionCodesRequest.js";
|
|
5
|
-
export {
|
|
5
|
+
export { UpdatePromotionCodeRequest } from "./UpdatePromotionCodeRequest.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { CreatePromotionCodeRequest } from "./CreatePromotionCodeRequest.js";
|
|
2
|
+
export { UpdatePromotionCodeRequest } from "./UpdatePromotionCodeRequest.js";
|