UNPKG

ebay-api

Version:

eBay API for Node and Browser

95 lines (94 loc) 3.18 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const index_js_1 = __importDefault(require("../../index.js")); /** * Post-Order Cancellation API */ class Cancellation extends index_js_1.default { get basePath() { return '/post-order/v2'; } get useIaf() { return true; } /** * Seller approves a cancellation request * * @param cancelId The unique eBay-assigned identifier of the cancellation request to be approved. */ approveCancellationRequest(cancelId) { cancelId = encodeURIComponent(cancelId); return this.post(`/cancellation/${cancelId}/approve`); } /** * Check the eligibility of an order cancellation * * @param legacyOrderId The unique ID of the order being canceled or the order being considered for cancellation. */ checkCancellationEligibility(legacyOrderId) { return this.post(`/cancellation/check_eligibility`, { legacyOrderId }); } /** * Buyer confirms the refund from a cancellation was received * * @param cancelId The unique eBay-assigned identifier of the cancellation/refund being confirmed. * @param payload the ConfirmRefundReceivedPayload */ confirmRefundReceived(cancelId, payload) { cancelId = encodeURIComponent(cancelId); return this.post(`/cancellation/${cancelId}/confirm`, payload); } /** * Request or perform an order cancellation. * * @param payload the CreateCancelRequest */ createCancellation(payload) { return this.post(`/cancellation`, payload); } /** * Retrieve the details of an order cancellation. * * @param cancelId Supply in this path parameter the unique eBay-assigned ID of the cancellation request to * retrieve. * @param fieldGroups The value set in this query parameter controls the level of detail that is returned in the * response. */ getCancellation(cancelId, fieldGroups) { cancelId = encodeURIComponent(cancelId); return this.get(`/cancellation/${cancelId}`, { params: { fieldgroups: fieldGroups } }); } /** * Seller rejects a cancellation request. * * @param cancelId The unique eBay-assigned identifier of the cancellation request to be rejected. * @param payload the RejectCancelRequest */ rejectCancellationRequest(cancelId, payload) { cancelId = encodeURIComponent(cancelId); return this.post(`/cancellation/${cancelId}/reject`, payload); } /** * Search for cancellations. * * @param params the SearchParams */ search(params) { return this.get(`/cancellation/search`, { params: { params } }); } } exports.default = Cancellation; Cancellation.id = 'Cancellation';