| Required role: | Admin | Required permission: | CanAccess |
| GET | /sync/products |
|---|
"use strict";
export class PaginationBase {
/** @param {{skip?:number,take?:number}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {?number}
* @description The number of query results to skip. */
skip;
/**
* @type {?number}
* @description The number of query results to include. */
take;
}
export class RetrieveAllProductsBase extends PaginationBase {
/** @param {{includeOrders?:boolean,skipOrders?:number,takeOrders?:number,skip?:number,take?:number}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
/**
* @type {?boolean}
* @description Should the related orders of the account be included in the retrieved products? */
includeOrders;
/**
* @type {?number}
* @description Specifies the number of orders to skip per product. Applicable only when 'IncludeOrders' is true. */
skipOrders;
/**
* @type {?number}
* @description Specifies the number of orders to include per product. Applicable only when 'IncludeOrders' is true. */
takeOrders;
}
export class Product {
/** @param {{id?:number,index?:number,name?:string,version?:string,description?:string,tags?:string[]}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {number}
* @description The unique identifier of the product. */
id;
/**
* @type {number}
* @description The position of this instance in a collection of 'Product' instances */
index;
/**
* @type {string}
* @description The name of the product. */
name;
/**
* @type {string}
* @description The version of the product. */
version;
/**
* @type {?string}
* @description The version of the product. */
description;
/**
* @type {string[]}
* @description Tags associated with the product. */
tags = [];
}
export class ProductQueryResponse extends QueryResponse {
/** @param {{ordersMap?:{ [index:number]: Order[]; },offset?:number,total?:number,results?:T[],meta?:{ [index:string]: string; },responseStatus?:ResponseStatus}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
/**
* @type {{ [index:number]: Order[]; }}
* @description The dictionary of orders associated with each found product. */
ordersMap = {};
}
export class RetrieveAllProducts extends RetrieveAllProductsBase {
/** @param {{includeOrders?:boolean,skipOrders?:number,takeOrders?:number,skip?:number,take?:number}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
}
/** @typedef T {any} */
export class QueryResponse {
/** @param {{offset?:number,total?:number,results?:T[],meta?:{ [index:string]: string; },responseStatus?:ResponseStatus}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
offset;
/** @type {number} */
total;
/** @type {T[]} */
results;
/** @type {{ [index:string]: string; }} */
meta;
/** @type {ResponseStatus} */
responseStatus;
}
JavaScript RetrieveAllProducts DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /sync/products HTTP/1.1 Host: taxfiling.staging.pwc.de Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
ordersMap:
{
0:
[
{
id: 0,
productId: 0,
accountId: 0,
name: String,
serviceName: String,
requestTimestamp: 0001-01-01,
responseTimestamp: 0001-01-01,
requestUri: String,
requestHttpMethod: String,
requestDuration: PT0S,
responseStatusCode: Continue,
clientIPAddress: String,
unitOfMeasurement: String,
processType: String,
dataType: String,
dataName: String,
creationDate: 0001-01-01,
expiryDate: 0001-01-01,
isTest: False
}
]
},
offset: 0,
total: 0,
results:
[
{
id: 0,
index: 0,
name: String,
version: String,
description: String,
tags:
[
String
]
}
],
meta:
{
String: String
},
responseStatus:
{
errorCode: String,
message: String,
stackTrace: String,
errors:
[
{
errorCode: String,
fieldName: String,
message: String,
meta:
{
String: String
}
}
],
meta:
{
String: String
}
}
}