@sp-api-sdk/schemas
Version:
Selling Parner API additional schema types
228 lines (227 loc) • 11.8 kB
TypeScript
import { type FromSchema } from 'json-schema-to-ts';
export declare const itemSalesEventChangeNotification: {
readonly $id: "https://example.com/example.json";
readonly type: "object";
readonly description: "The root schema comprises the entire JSON document.";
readonly examples: readonly [{
readonly notificationVersion: "2020-09-04";
readonly notificationType: "ITEM_SALES_EVENT_CHANGE";
readonly payloadVersion: "2020-09-04";
readonly eventTime: "2023-02-07T16:05:32.378Z";
readonly payload: {
readonly itemSalesEventChanges: readonly [{
readonly accountId: "amzn1.merchant.o.A21CXK3C4ERTY8";
readonly marketplaceId: "ATVPDKIKX0DER";
readonly currencyCode: "USD";
readonly startTime: "2023-02-07T15:00:00Z";
readonly endTime: "2023-02-07T16:00:00Z";
readonly asin: "B00032HE0O";
readonly orderedUnits: 9;
readonly orderedRevenue: 80.91;
}, {
readonly accountId: "amzn1.merchant.o.A21CXK3C4ERTY8";
readonly marketplaceId: "ATVPDKIKX0DER";
readonly currencyCode: "USD";
readonly startTime: "2023-02-07T15:00:00Z";
readonly endTime: "2023-02-07T16:00:00Z";
readonly asin: "B00094A20U";
readonly orderedUnits: 5;
readonly orderedRevenue: 527.6;
}];
};
readonly notificationMetadata: {
readonly applicationId: "amzn1.sellerapps.app.aacccfff-4455-4b7c-4422-664ecacdd336";
readonly subscriptionId: "d0e9e693-c3ad-4373-979f-ed4ec98dd746";
readonly publishTime: "2023-02-07T16:45:32.378Z";
readonly notificationId: "d0e9e693-c3ad-4373-979f-ed4ec98dd746";
};
}];
readonly required: readonly ["notificationVersion", "notificationType", "payloadVersion", "eventTime", "payload", "notificationMetadata"];
readonly properties: {
readonly notificationVersion: {
readonly $id: "#/properties/notificationVersion";
readonly type: "string";
readonly examples: readonly ["2020-09-04"];
};
readonly notificationType: {
readonly $id: "#/properties/notificationType";
readonly type: "string";
readonly examples: readonly ["ITEM_SALES_EVENT_CHANGE"];
};
readonly payloadVersion: {
readonly $id: "#/properties/payloadVersion";
readonly type: "string";
readonly examples: readonly ["2020-09-04"];
};
readonly eventTime: {
readonly $id: "#/properties/eventTime";
readonly type: "string";
readonly examples: readonly ["2023-02-07T16:45:32.378Z"];
};
readonly payload: {
readonly $id: "#/properties/payload";
readonly $ref: "#/definitions/Payload";
};
readonly notificationMetadata: {
readonly $id: "#/properties/notificationMetadata";
readonly $ref: "#/definitions/NotificationMetadata";
};
};
readonly definitions: {
readonly Payload: {
readonly type: "object";
readonly examples: readonly [{
readonly itemSalesEventChanges: readonly [{
readonly accountId: "amzn1.merchant.o.A21CXK3C4ERTY8";
readonly marketplaceId: "ATVPDKIKX0DER";
readonly currencyCode: "USD";
readonly startTime: "2023-02-07T15:00:00Z";
readonly endTime: "2023-02-07T16:00:00Z";
readonly asin: "B00032HE0O";
readonly orderedUnits: 9;
readonly orderedRevenue: 80.91;
}, {
readonly accountId: "amzn1.merchant.o.A21CXK3C4ERTY8";
readonly marketplaceId: "ATVPDKIKX0DER";
readonly currencyCode: "USD";
readonly startTime: "2023-02-07T15:00:00Z";
readonly endTime: "2023-02-07T16:00:00Z";
readonly asin: "B00094A20U";
readonly orderedUnits: 5;
readonly orderedRevenue: 527.6;
}];
}];
readonly required: readonly ["itemSalesEventChanges"];
readonly properties: {
readonly itemSalesEventChanges: {
readonly $id: "#/definitions/Payload/properties/itemSalesEventChanges";
readonly $ref: "#/definitions/ItemSalesEventChanges";
};
};
};
readonly ItemSalesEventChanges: {
readonly type: "array";
readonly examples: readonly [readonly [{
readonly accountId: "amzn1.merchant.o.A21CXK3C4ERTY8";
readonly marketplaceId: "ATVPDKIKX0DER";
readonly currencyCode: "USD";
readonly startTime: "2023-02-07T15:00:00Z";
readonly endTime: "2023-02-07T16:00:00Z";
readonly asin: "B00032HE0O";
readonly orderedUnits: 9;
readonly orderedRevenue: 80.91;
}, {
readonly accountId: "amzn1.merchant.o.A21CXK3C4ERTY8";
readonly marketplaceId: "ATVPDKIKX0DER";
readonly currencyCode: "USD";
readonly startTime: "2023-02-07T15:00:00Z";
readonly endTime: "2023-02-07T16:00:00Z";
readonly asin: "B00094A20U";
readonly orderedUnits: 5;
readonly orderedRevenue: 527.6;
}]];
readonly items: {
readonly $ref: "#/definitions/ItemSalesEventChange";
};
};
readonly ItemSalesEventChange: {
readonly type: "object";
readonly examples: readonly [{
readonly accountId: "amzn1.merchant.o.A21CXK3C4ERTY8";
readonly marketplaceId: "ATVPDKIKX0DER";
readonly currencyCode: "USD";
readonly startTime: "2023-02-07T15:00:00Z";
readonly endTime: "2023-02-07T16:00:00Z";
readonly asin: "B00032HE0O";
readonly orderedUnits: 9;
readonly orderedRevenue: 80.91;
}];
readonly required: readonly ["accountId", "marketplaceId", "currencyCode", "startTime", "endTime", "asin", "orderedUnits", "orderedRevenue"];
readonly properties: {
readonly accountId: {
readonly $id: "#/definitions/ItemSalesEventChange/properties/accountId";
readonly type: "string";
readonly description: "The merchant customer ID or vendor group ID of the partner account this notification is sent to.";
readonly examples: readonly ["amzn1.merchant.o.A21CXK3C4ERTY8", "amzn1.vg.6213651"];
};
readonly marketplaceId: {
readonly $id: "#/definitions/ItemSalesEventChange/properties/marketplaceId";
readonly type: "string";
readonly description: "The marketplace identifier of the sales data.";
readonly examples: readonly ["ATVPDKIKX0DER"];
};
readonly currencyCode: {
readonly $id: "#/definitions/ItemSalesEventChange/properties/currencyCode";
readonly type: "string";
readonly description: "The currency code of any monetary amounts in ISO 4217 format.";
readonly examples: readonly ["USD"];
};
readonly startTime: {
readonly $id: "#/definitions/ItemSalesEventChange/properties/startTime";
readonly type: "string";
readonly format: "date-time";
readonly description: "The start of the date-time range of the sales data in ISO 8601 format in UTC time.";
readonly examples: readonly ["2023-02-07T15:00:00Z"];
};
readonly endTime: {
readonly $id: "#/definitions/ItemSalesEventChange/properties/endTime";
readonly type: "string";
readonly format: "date-time";
readonly description: "The end of the date-time range of the sales data in ISO 8601 format in UTC time.";
readonly examples: readonly ["2023-02-07T16:00:00Z"];
};
readonly asin: {
readonly $id: "#/definitions/ItemSalesEventChange/properties/asin";
readonly type: "string";
readonly description: "The Amazon Standard Identification Number of the product.";
readonly examples: readonly ["B00032HE0O"];
};
readonly orderedUnits: {
readonly $id: "#/definitions/ItemSalesEventChange/properties/orderedUnits";
readonly type: "integer";
readonly description: "The number of units ordered by Amazon customers in the specified time frame. This number can be negative if there are more cancellations than orders.";
readonly examples: readonly [9, -5];
};
readonly orderedRevenue: {
readonly $id: "#/definitions/ItemSalesEventChange/properties/orderedRevenue";
readonly type: "number";
readonly description: "The ordered product sales in the specified time frame. Adjustments are made for cancellations.";
readonly examples: readonly [80.91, -4.2];
};
};
};
readonly NotificationMetadata: {
readonly type: "object";
readonly examples: readonly [{
readonly applicationId: "amzn1.sellerapps.app.aacccfff-4455-4b7c-4422-664ecacdd336";
readonly subscriptionId: "d0e9e693-c3ad-4373-979f-ed4ec98dd746";
readonly publishTime: "2023-02-07T16:45:32.378Z";
readonly notificationId: "d0e9e693-c3ad-4373-979f-ed4ec98dd746";
}];
readonly required: readonly ["applicationId", "subscriptionId", "publishTime", "notificationId"];
readonly properties: {
readonly applicationId: {
readonly $id: "#/definitions/NotificationMetadata/properties/applicationId";
readonly type: "string";
readonly examples: readonly ["amzn1.sellerapps.app.aacccfff-4455-4b7c-4422-664ecacdd336"];
};
readonly subscriptionId: {
readonly $id: "#/definitions/NotificationMetadata/properties/subscriptionId";
readonly type: "string";
readonly examples: readonly ["d0e9e693-c3ad-4373-979f-ed4ec98dd746"];
};
readonly publishTime: {
readonly $id: "#/definitions/NotificationMetadata/properties/publishTime";
readonly type: "string";
readonly examples: readonly ["2023-02-07T16:45:32.378Z"];
};
readonly notificationId: {
readonly $id: "#/definitions/NotificationMetadata/properties/notificationId";
readonly type: "string";
readonly examples: readonly ["d0e9e693-c3ad-4373-979f-ed4ec98dd746"];
};
};
};
};
};
export type ItemSalesEventChangeNotification = FromSchema<typeof itemSalesEventChangeNotification>;