@sp-api-sdk/schemas
Version:
Selling Parner API additional schema types
283 lines (282 loc) • 13.7 kB
JavaScript
export const orderStatusChangeNotification = {
$id: 'http://example.com/example.json',
type: 'object',
title: 'The root schema',
description: 'The root schema comprises the entire JSON document.',
default: {},
examples: [
{
NotificationVersion: '1.0',
NotificationType: 'ORDER_STATUS_CHANGE',
PayloadVersion: '1.0',
EventTime: '2020-07-13T19:42:04.284Z',
Payload: {
OrderStatusChangeNotification: {
SellerId: 'AXXXXXXXXXXXXX',
MarketplaceId: 'ATVPDKIKX0DER',
AmazonOrderId: '333-7777777-7777777',
PurchaseDate: 1_595_882_000_633,
OrderStatus: 'Unshipped',
DestinationPostalCode: '48110',
SupplySourceId: '55448834-0d79-5155-75c4-8529543a7c31',
OrderItemId: 'OIID34853450',
SellerSKU: 'SellerSKUID1',
Quantity: 45,
FulfillmentChannel: 'MFN',
},
},
NotificationMetadata: {
ApplicationId: 'app-id-d0e9e693-c3ad-4373-979f-ed4ec98dd746',
SubscriptionId: 'subscription-id-d0e9e693-c3ad-4373-979f-ed4ec98dd746',
PublishTime: '2020-07-13T19:42:04.284Z',
NotificationId: 'd0e9e693-c3ad-4373-979f-ed4ec98dd746',
},
},
],
required: [
'NotificationVersion',
'NotificationType',
'PayloadVersion',
'EventTime',
'Payload',
'NotificationMetadata',
],
properties: {
NotificationVersion: {
$id: '#/properties/NotificationVersion',
type: 'string',
title: 'The NotificationVersion schema',
description: 'An explanation about the purpose of this instance.',
default: '',
examples: ['1.0'],
},
NotificationType: {
$id: '#/properties/NotificationType',
type: 'string',
title: 'The NotificationType schema',
description: 'An explanation about the purpose of this instance.',
default: '',
examples: ['ORDER_STATUS_CHANGE'],
},
PayloadVersion: {
$id: '#/properties/PayloadVersion',
type: 'string',
title: 'The PayloadVersion schema',
description: 'An explanation about the purpose of this instance.',
default: '',
examples: ['1.0'],
},
EventTime: {
$id: '#/properties/EventTime',
type: 'string',
title: 'The EventTime schema',
description: 'An explanation about the purpose of this instance.',
default: '',
examples: ['2020-07-13T19:42:04.284Z'],
},
Payload: {
$id: '#/properties/Payload',
type: 'object',
title: 'The Payload schema',
description: 'An explanation about the purpose of this instance.',
default: {},
examples: [
{
OrderStatusChangeNotification: {
SellerId: 'AXXXXXXXXXXXXX',
MarketplaceId: 'ATVPDKIKX0DER',
AmazonOrderId: '333-7777777-7777777',
PurchaseDate: 1_595_882_000_633,
OrderStatus: 'Unshipped',
DestinationPostalCode: '48110',
SupplySourceId: '55448834-0d79-5155-75c4-8529543a7c31',
OrderItemId: 'OIID34853450',
SellerSKU: 'SellerSKUID1',
Quantity: 45,
FulfillmentChannel: 'MFN',
},
},
],
required: ['OrderStatusChangeNotification'],
properties: {
OrderStatusChangeNotification: {
$id: '#/properties/Payload/properties/OrderStatusChangeNotification',
type: 'object',
title: 'The OrderStatusChangeNotification schema',
description: 'An explanation about the purpose of this instance.',
default: {},
examples: [
{
SellerId: 'AXXXXXXXXXXXXX',
MarketplaceId: 'ATVPDKIKX0DER',
AmazonOrderId: '333-7777777-7777777',
PurchaseDate: 1_595_882_000_633,
OrderStatus: 'Unshipped',
DestinationPostalCode: '48110',
SupplySourceId: '55448834-0d79-5155-75c4-8529543a7c31',
OrderItemId: 'OIID34853450',
SellerSKU: 'SellerSKUID1',
Quantity: 45,
FulfillmentChannel: 'MFN',
},
],
required: [
'SellerId',
'MarketplaceId',
'AmazonOrderId',
'PurchaseDate',
'OrderStatus',
'DestinationPostalCode',
'SupplySourceId',
'OrderItemId',
'SellerSKU',
'Quantity',
'FulfillmentChannel',
],
properties: {
SellerId: {
$id: '#/properties/Payload/properties/OrderStatusChangeNotification/properties/SellerId',
type: 'string',
title: 'The SellerId schema',
description: 'The selling partner identifier.',
default: '',
examples: ['AXXXXXXXXXXXXX'],
},
MarketplaceId: {
$id: '#/properties/Payload/properties/OrderStatusChangeNotification/properties/MarketplaceId',
type: 'string',
title: 'The MarketplaceId schema',
description: 'Amazon marketplace identifier of the affected order.',
examples: ['ATVPDKIKX0DER'],
},
AmazonOrderId: {
$id: '#/properties/Payload/properties/OrderStatusChangeNotification/properties/AmazonOrderId',
type: 'string',
title: 'The AmazonOrderId schema',
description: 'An Amazon-defined order identifier in 3-7-7 format.',
default: '',
examples: ['333-7777777-7777777'],
},
PurchaseDate: {
$id: '#/properties/Payload/properties/OrderStatusChangeNotification/properties/PurchaseDate',
type: ['integer', 'null'],
title: 'The PurchaseDate schema',
description: 'The purchase date of the order in Epoch time.',
default: 0,
examples: [1_595_882_000_633],
},
OrderStatus: {
$id: '#/properties/Payload/properties/OrderStatusChangeNotification/properties/OrderStatus',
type: 'string',
title: 'The OrderStatus schema',
description: 'The current order status. The possible values include UpComing, Pending, Unshipped, PartiallyShipped, PendingAvailability, Canceled, InvoiceUnconfirmed, Shipped, and Unfulfillable.',
default: '',
examples: ['Unshipped'],
},
DestinationPostalCode: {
$id: '#/properties/Payload/properties/OrderStatusChangeNotification/properties/DestinationPostalCode',
type: ['string', 'null'],
title: 'The DestinationPostalCode schema',
description: 'The destination postal code.',
default: '',
examples: ['48110'],
},
SupplySourceId: {
$id: '#/properties/Payload/properties/OrderStatusChangeNotification/properties/SupplySourceId',
type: ['string', 'null'],
title: 'The SupplySourceId schema',
description: 'The unique identifier of the supply source.',
default: '',
examples: ['55448834-0d79-5155-75c4-8529543a7c31'],
},
OrderItemId: {
$id: '#/properties/Payload/properties/OrderStatusChangeNotification/properties/OrderItemId',
type: 'string',
title: 'The OrderItemId schema',
description: 'The Amazon-defined order item identifier.',
default: '',
examples: ['OIID34853450'],
},
SellerSKU: {
$id: '#/properties/Payload/properties/OrderStatusChangeNotification/properties/SellerSKU',
type: 'string',
title: 'The SellerSKU schema',
description: 'The seller-specific SKU identifier for an item.',
default: '',
examples: ['SellerSKUID1'],
},
Quantity: {
$id: '#/properties/Payload/properties/OrderStatusChangeNotification/properties/Quantity',
type: 'integer',
title: 'The Quantity schema',
description: 'The number of items in the order.',
default: 0,
examples: [45],
},
FulfillmentChannel: {
$id: '#/properties/Payload/properties/OrderStatusChangeNotification/properties/FulfillmentChannel',
type: 'string',
title: 'The FulfillmentChannel schema',
description: 'Fulfillment channel of the affected order, MFN or AFN.',
examples: ['MFN'],
},
},
additionalProperties: true,
},
},
additionalProperties: true,
},
NotificationMetadata: {
$id: '#/properties/NotificationMetadata',
type: 'object',
title: 'The NotificationMetadata schema',
description: 'An explanation about the purpose of this instance.',
default: {},
examples: [
{
ApplicationId: 'app-id-d0e9e693-c3ad-4373-979f-ed4ec98dd746',
SubscriptionId: 'subscription-id-d0e9e693-c3ad-4373-979f-ed4ec98dd746',
PublishTime: '2020-07-13T19:42:04.284Z',
NotificationId: 'd0e9e693-c3ad-4373-979f-ed4ec98dd746',
},
],
required: ['ApplicationId', 'SubscriptionId', 'PublishTime', 'NotificationId'],
properties: {
ApplicationId: {
$id: '#/properties/NotificationMetadata/properties/ApplicationId',
type: 'string',
title: 'The ApplicationId schema',
description: 'An explanation about the purpose of this instance.',
default: '',
examples: ['app-id-d0e9e693-c3ad-4373-979f-ed4ec98dd746'],
},
SubscriptionId: {
$id: '#/properties/NotificationMetadata/properties/SubscriptionId',
type: 'string',
title: 'The SubscriptionId schema',
description: 'An explanation about the purpose of this instance.',
default: '',
examples: ['subscription-id-d0e9e693-c3ad-4373-979f-ed4ec98dd746'],
},
PublishTime: {
$id: '#/properties/NotificationMetadata/properties/PublishTime',
type: 'string',
title: 'The PublishTime schema',
description: 'An explanation about the purpose of this instance.',
default: '',
examples: ['2020-07-13T19:42:04.284Z'],
},
NotificationId: {
$id: '#/properties/NotificationMetadata/properties/NotificationId',
type: 'string',
title: 'The NotificationId schema',
description: 'An explanation about the purpose of this instance.',
default: '',
examples: ['d0e9e693-c3ad-4373-979f-ed4ec98dd746'],
},
},
additionalProperties: true,
},
},
additionalProperties: true,
};