UNPKG

ebay-api

Version:

eBay API for Node and Browser

95 lines (94 loc) 3.25 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 Case Management API */ class Case extends index_js_1.default { get basePath() { return '/post-order/v2'; } get useIaf() { return true; } /** * Buyer or seller appeals a case decision. * * @param caseId The unique identifier of a case. * @param payload the AppealRequest */ appealCaseDecision(caseId, payload) { const id = encodeURIComponent(caseId); return this.post(`/casemanagement/${id}/appeal`, payload); } /** * Check the eligibility of an order cancellation. * * @param caseId The unique identifier of a case. * @param payload the BuyerCloseCaseRequest */ closeCase(caseId, payload) { const id = encodeURIComponent(caseId); return this.post(`/casemanagement/${id}/close`, payload); } /** * Retrieve the details related to a specific case. * * @param caseId The unique identifier of a case. */ getCase(caseId) { const id = encodeURIComponent(caseId); return this.get(`/casemanagement/${id}`); } /** * Seller issues a refund for a case. * * @param caseId The unique identifier of a case. * @param payload the CaseVoluntaryRefundRequest (Text) */ issueCaseRefund(caseId, payload) { const id = encodeURIComponent(caseId); return this.post(`/casemanagement/${id}/issue_refund`, payload); } /** * This call allows the buyer to provide shipment tracking information for the item that is being returned to the * seller. * * @param caseId The unique identifier of a case. * @param shippingCarrierName The shipping carrier that is used to ship the item, such as 'FedEx', 'UPS', or * 'USPS'. * @param trackingNumber The tracking number assigned by the shipping carrier to the item shipment. */ provideReturnShipmentInfo(caseId, { shippingCarrierName, trackingNumber }) { const id = encodeURIComponent(caseId); return this.post(`/casemanagement/${id}/provide_shipment_info`, { shippingCarrierName, trackingNumber }); } /** * Seller provides a return address to the buyer. * * @param cancelId The unique eBay-assigned identifier of the cancellation request to be rejected. * @param payload the ReturnAddressRequest */ providesReturnAddress(cancelId, payload) { const id = encodeURIComponent(cancelId); return this.post(`/casemanagement/${id}/provide_return_address`, payload); } /** * This call is used to search for cases using multiple filter types. * * @param params the SearchParams */ search(params) { return this.get(`/casemanagement/search`, { params }); } } exports.default = Case; Case.id = 'Case';