Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ For more examples, check out the [examples directory](./examples).
| API | Implemented |
|:-------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Buy API** | ✔ Browse API `v1.10.0`<br>✔ Deal API `v1.3.0`<br>✔ Feed API `v1.3.1`<br>✔ Marketing API `v1_beta.1.0`<br>✔ Offer API `v1_beta.0.0`<br>✔ Order API `v1_beta.20.0`<br>✔ Marketplace Insights API `v1_beta.2.2` |
| **Commerce API** | ✔ Catalog API `v1_beta.3.1`<br>✔ Charity API `v1.2.0`<br>✔ Identity API `v1.0.0`<br>✔ Notification API `v1.2.0`<br>✔ Taxonomy API `v1.0.0`<br>✔ Translation API `v1_beta.1.4`<br>✔ Media API `v1_beta.1.0`<br>✔ Message API `v1.0.0` |
| **Commerce API** | ✔ Catalog API `v1_beta.3.1`<br>✔ Charity API `v1.2.0`<br>✔ Identity API `v1.0.0`<br>✔ Notification API `v1.2.0`<br>✔ Taxonomy API `v1.0.0`<br>✔ Translation API `v1_beta.1.4`<br>✔ Media API `v1_beta.1.0`<br>✔ Message API `v1.0.0`<br>✔ Feedback API `v1_beta.1.0.0` |
| **Developer API** | ✔ Analytics API |
| **Post Order API** | ✔ Cancellation API<br>✔ Case Management API<br>✔ Inquiry API<br>✔ Return API |
| **Sell API** | ✔ Account API `v1.9.0`<br>✔ Analytics API `v1.3.0`<br>✔ Compliance API `v1.4.1`<br>✔ Feed API `v1.3.1`<br>✔ Finance API `v1.9.0`<br>✔ Fulfillment API `v1.19.10`<br>✔ Inventory API `v1.18.0`<br>✔ Listing API `v1_beta.2.1`<br>✔ Logistics API `v1_beta.0.0`<br>✔ Marketing API `v1.17.0`<br>✔ Metadata API `v1.7.1`<br>✔ Negotiation API `v1.1.0`<br>✔ Recommendation API `v1.1.0` |
Expand Down
4 changes: 4 additions & 0 deletions redocly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ apis:
root: specs/commerce_message_v1_oas3.json
x-openapi-ts:
output: src/types/restful/specs/commerce_message_v1_oas3.ts
commerce_feedback_v1_beta:
root: specs/commerce_feedback_v1_beta_oas3.json
x-openapi-ts:
output: src/types/restful/specs/commerce_feedback_v1_beta_oas3.ts
commerce_notification_v1:
root: specs/commerce_notification_v1_oas3.json
x-openapi-ts:
Expand Down
1,548 changes: 1,548 additions & 0 deletions specs/commerce_feedback_v1_beta_oas3.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/api/apiFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
Catalog,
Charity,
Commerce,
Feedback,
Identity,
Media,
Message,
Expand Down Expand Up @@ -71,7 +72,8 @@ export default class ApiFactory extends Api {
media: this.createRestfulApi(Media),
translation: this.createRestfulApi(Translation),
taxonomy: this.createRestfulApi(Taxonomy),
message: this.createRestfulApi(Message)
message: this.createRestfulApi(Message),
feedback: this.createRestfulApi(Feedback)
};
}

Expand Down
140 changes: 140 additions & 0 deletions src/api/restful/commerce/feedback/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
import { operations } from '../../../../types/restful/specs/commerce_feedback_v1_beta_oas3.js';
import { LeaveFeedbackRequest, RespondToFeedbackRequest } from '../../../../types/restfulTypes.js';
import Restful, { OpenApi } from '../../index.js';

/**
* The eBay Feedback API includes resources for retrieving items awaiting feedback, retrieving and
* submitting feedback entries, providing feedback rating summaries, and responding to feedback.
* These methods allow users to manage feedback across buying and selling activities.
*
* https://api.ebay.com/oauth/api_scope/commerce.feedback
*/
export default class Feedback extends Restful implements OpenApi<operations> {

static id = 'Feedback';

get basePath(): string {
return '/commerce/feedback/v1';
}

/**
* This method retrieves the order line items that are awaiting feedback from the user.
*
* @param filter This query parameter limits the response using one or more comma-separated filters.
* @param limit The maximum number of entries to return on each page of the paginated response.
* @param offset The number of entries to skip in the result set before returning the first entry.
* @param sort This query parameter configures the order of the returned items.
*/
public getItemsAwaitingFeedback({
filter,
limit,
offset,
sort
}: {
filter?: string,
limit?: number,
offset?: number,
sort?: string,
} = {}) {
return this.get('/awaiting_feedback', {
params: {
filter,
limit,
offset,
sort
}
});
}

/**
* This method retrieves feedback for the specified user ID and feedback type (received or left).
*
* @param userId The eBay username of the user for which feedback is being retrieved.
* @param feedbackType The type of feedback records to return (e.g. FEEDBACK_RECEIVED or FEEDBACK_LEFT).
* @param feedbackId Returns only the specific feedback record identified by this feedback ID.
* @param filter Limits the response using one or more comma-separated filters (e.g. commentType).
* @param limit The maximum number of entries to return on each page of the paginated response.
* @param listingId Limits feedback entries to those associated with the specified listing.
* @param offset The number of entries to skip in the result set before returning the first entry.
* @param orderLineItemId Retrieves feedback entries related to the specified order line item ID.
* @param sort Configures the order of the returned items.
* @param transactionId Limits feedback entries to those associated with the specified transaction ID.
*/
public getFeedback({
userId,
feedbackType,
feedbackId,
filter,
limit,
listingId,
offset,
orderLineItemId,
sort,
transactionId
}: {
userId: string,
feedbackType: string,
feedbackId?: string,
filter?: string,
limit?: number,
listingId?: string,
offset?: number,
orderLineItemId?: string,
sort?: string,
transactionId?: string,
}) {
return this.get('/feedback', {
params: {
user_id: userId,
feedback_type: feedbackType,
feedback_id: feedbackId,
filter,
limit,
listing_id: listingId,
offset,
order_line_item_id: orderLineItemId,
sort,
transaction_id: transactionId
}
});
}

/**
* This method submits a feedback entry for an order line item.
*
* @param body LeaveFeedbackRequest
*/
public leaveFeedback(body: LeaveFeedbackRequest) {
return this.post('/feedback', body);
}

/**
* This method retrieves a summary of the feedback ratings for the specified user.
*
* @param userId The eBay username of the user for which the rating summary is being retrieved.
* @param filter Limits the response based on the specified filter values (e.g. ratingType).
*/
public getFeedbackRatingSummary({
userId,
filter
}: {
userId: string,
filter: string,
}) {
return this.get('/feedback_rating_summary', {
params: {
user_id: userId,
filter
}
});
}

/**
* This method submits a response (a public reply or a follow-up) to a feedback entry.
*
* @param body RespondToFeedbackRequest
*/
public respondToFeedback(body: RespondToFeedbackRequest) {
return this.post('/respond_to_feedback', body);
}
}
5 changes: 4 additions & 1 deletion src/api/restful/commerce/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Notification from './notification/index.js';
import Taxonomy from './taxonomy/index.js';
import Translation from './translation/index.js';
import Message from './message/index.js';
import Feedback from './feedback/index.js';

export type Commerce = {
catalog: Catalog;
Expand All @@ -16,6 +17,7 @@ export type Commerce = {
translation: Translation;
media: Media;
message: Message;
feedback: Feedback;
};

export {
Expand All @@ -26,5 +28,6 @@ export {
Taxonomy,
Translation,
Media,
Message
Message,
Feedback
};
Loading
Loading