Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
feat: Import product prices endpoint (#859)
Browse files Browse the repository at this point in the history
  • Loading branch information
petro97 authored Sep 13, 2023
1 parent 676510f commit 1e789d6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/endpoints/price-books.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ class PriceBooksEndpoint extends CRUDExtend {

this.endpoint = 'pricebooks'
}

ImportProductPrices(file) {
return this.request.send(`${this.endpoint}/import`, 'POST', file)
}

}

export default PriceBooksEndpoint
1 change: 1 addition & 0 deletions src/types/price-book-price-modifiers.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export interface PriceBookPriceModifierBase {
attributes: {
modifier_type: string
name: string
external_ref?: string | null
currencies: {
[key: string]: {
includes_tax: boolean
Expand Down
1 change: 1 addition & 0 deletions src/types/price-book-prices.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export interface PriceBookPriceBase {
}
}
}
external_ref?: string | null
sku: string
}
}
Expand Down
11 changes: 10 additions & 1 deletion src/types/price-books.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
* Products
* Description: Products are the core resource to any Commerce Cloud project. They can be associated by category, collection, brands, and more.
*/
import { Identifiable, CrudQueryableResource } from './core'
import { Identifiable, CrudQueryableResource, Resource } from './core'
import { PriceBookPricesEndpoint } from './price-book-prices'
import { PriceBookPriceModifierEndpoint } from './price-book-price-modifiers'
import { PcmJob } from "./pcm";

/**
* Core PCM Product Base Interface
Expand All @@ -17,6 +18,7 @@ export interface PriceBookBase {
description?: string
created_at?: string
updated_at?: string
external_ref?: string | null
meta?: {
// TODO
}
Expand Down Expand Up @@ -55,4 +57,11 @@ export interface PriceBooksEndpoint
endpoint: 'pricebooks'
Prices: PriceBookPricesEndpoint
PriceModifiers: PriceBookPriceModifierEndpoint

/**
* Import price books
* @param file - The file you want to upload. The file type is `.jsonl`.
* @constructor
*/
ImportProductPrices(file: FormData): Promise<Resource<PcmJob>>
}

0 comments on commit 1e789d6

Please sign in to comment.