Core.rq_marketplace is a collection of function wrappers around the Discogs API for marketplace interactions.

Inventory

get_inventory[source]

get_inventory(user:Union[UserWithoutAuthentication, UserWithUserTokenBasedAuthentication], username:str, status:Optional[StatusInventory]=None, page:Optional[int]=None, per_page:Optional[int]=None, sort:Optional[SortOptionsInventory]=None, sort_order:Optional[SortOrder]=None)

Get a list of listings of a given user inventory.

If you are not authenticated as the inventory owner, only items that have a status of "For Sale" will be visible.

No user Authentication needed.

Parameters:

user: user object (required)

username: string (required) -> The username for whose inventory you are fetching

status: string (optional) -> Only show items with this status.

page: number (optional) -> The page you want to request.

per_page: number (optional) -> The number of items per page.

sort: string (optional) -> Sort items by this field.

sort_order: string (optional) -> Sort items in a particular order (one of asc, desc)

# Example for usage of get_inventory
get_inventory(user=example_user, 
              username="Les_nuits_noires", 
              status=StatusInventory.for_sale,
              page=1, 
              per_page=3, 
              sort=SortOptionsInventory.price, 
              sort_order=SortOrder.asc)
<Response [200]>

Listing

get_listing[source]

get_listing(user:Union[UserWithoutAuthentication, UserWithUserTokenBasedAuthentication], listing_id:int, curr_abbr:Optional[CurrAbbr]=None)

Get all the information about the requested listing from the given user inventory.

No user Authentication needed.

Parameters:

user: user object (required)

listing_id: number (required) -> The username for whose inventory you are fetching

curr_abbr: string (optional) -> Currency for marketplace data. Defaults to the authenticated users currency.

# Example for usage of get_listing
get_listing(user=example_user, 
            listing_id=1034876519, 
            curr_abbr=CurrAbbr.EUR)
<Response [200]>

update_listing[source]

update_listing(user:UserWithUserTokenBasedAuthentication, listing_id:int, release_id:int, condition:ReleaseCondition, price:float, sleeve_condition:Optional[SleeveCondition]=None, status:Optional[StatusInventory]=None, comments:Optional[str]=None, allow_offers:Optional[bool]=None, external_id:Optional[str]=None, location:Optional[str]=None, weight:Optional[int]=None, format_quantity:Optional[int]=None, curr_abbr:Optional[CurrAbbr]=None)

Update the data associated with a listing.

User Authentication needed.

Parameters:

user: user object (required)

listing_id: number (required) -> The username for whose inventory you are fetching

release_id: number (required) -> The ID of the release you are posting

condition: string (required) -> The condition of the release you are posting.

price: number (required) -> The price of the item (in the seller’s currency).

status: string (required) -> The status of the listing. Defaults to For Sale.

sleeve_condition: string (optional) -> The condition of the sleeve of the item you are posting.

comments: string (optional) -> Any remarks about the item that will be displayed to buyers.

allow_offers: boolean (optional) -> Whether or not to allow buyers to make offers on the item. Defaults to false.

external_id: string (optional) -> A freeform field that can be used for the seller’s own reference. -> Information stored here will not be displayed to anyone other than the seller. -> This field is called “Private Comments” on the Discogs website.

location: string (optional) -> A freeform field that is intended to help identify an item’s physical storage location. -> Information stored here will not be displayed to anyone other than the seller. -> This field will be visible on the inventory management page and will be available in inventory exports via the website.

weight: number (optional) -> The weight, in grams, of this listing, for the purpose of calculating shipping. -> Set this field to auto to have the weight automatically estimated for you.

format_quantity: number (optional) -> The number of items this listing counts as, for the purpose of calculating shipping. -> This field is called “Counts As” on the Discogs website. -> Set this field to auto to have the quantity automatically estimated for you.

curr_abbr: string (optional) -> Currency for marketplace data. Defaults to the authenticated users currency.

# Example for usage of update_listing

update_listing(user=example_user,
               listing_id=1059961457,
               release_id=10361797,
               condition=ReleaseCondition.mint,
               price=5.42,
               status=StatusInventory.for_sale,
               sleeve_condition=SleeveCondition.mint,
               comments="CD is new and unplayed",
               allow_offers=False,
               external_id="Private Comment",
               location="Test Location",
               weight=100,
               format_quantity=1,
               curr_abbr=CurrAbbr.EUR) 
<Response [204]>

delete_listing[source]

delete_listing(user:UserWithUserTokenBasedAuthentication, listing_id:int)

Delete a given listing from the inventory.

User Authentication needed.

Parameters:

user: user object (required)

listing_id: number (required) -> The username for whose inventory you are fetching.

# Example for usage of delete_listing

delete_listing(user=example_user, 
               listing_id=1052411061)
<Response [204]>

add_new_listing[source]

add_new_listing(user:UserWithUserTokenBasedAuthentication, release_id:int, condition:ReleaseCondition, price:float, status:StatusNewListing, sleeve_condition:Optional[SleeveCondition]=None, comments:Optional[str]=None, allow_offers:Optional[bool]=None, external_id:Optional[str]=None, location:Optional[str]=None, weight:Optional[int]=None, format_quantity:Optional[int]=None)

Add a new listing to the given user inventory.

User Authentication needed.

Parameters:

user: user object (required)

release_id: number (required) -> The ID of the release you are posting

condition: string (required) -> The condition of the release you are posting.

price: number (required) -> The price of the item (in the seller’s currency).

status: string (required) -> The status of the listing. Defaults to For Sale.

sleeve_condition: string (optional) -> The condition of the sleeve of the item you are posting.

comments: string (optional) -> Any remarks about the item that will be displayed to buyers.

allow_offers: boolean (optional) -> Whether or not to allow buyers to make offers on the item. Defaults to false.

external_id: string (optional) -> A freeform field that can be used for the seller’s own reference. -> Information stored here will not be displayed to anyone other than the seller. -> This field is called “Private Comments” on the Discogs website.

location: string (optional) -> A freeform field that is intended to help identify an item’s physical storage location. -> Information stored here will not be displayed to anyone other than the seller. -> This field will be visible on the inventory management page and will be available in inventory exports via the website.

weight: number (optional) -> The weight, in grams, of this listing, for the purpose of calculating shipping. -> Set this field to auto to have the weight automatically estimated for you.

format_quantity: number (optional) -> The number of items this listing counts as, for the purpose of calculating shipping. -> This field is called “Counts As” on the Discogs website. -> Set this field to auto to have the quantity automatically estimated for you.

# Example for usage of add_new_listing

add_new_listing(user=example_user,
                release_id=10361797,
                condition=ReleaseCondition.mint,
                price=10.00,
                status=StatusNewListing.draft,
                sleeve_condition=SleeveCondition.mint,
                comments="Standard CD",
                allow_offers=False,
                external_id="Private Comment",
                location="Test Location",
                weight=100,
                format_quantity=1) 
<Response [201]>

Order

get_order[source]

get_order(user:UserWithUserTokenBasedAuthentication, order_id:str)

Get the data associated with the given order.

User Authentication needed.

Parameters:

user: user object (required)

order_id: string (required) -> The ID of the order you are fetching

# Example for usage of get_order

get_order(user=example_user, 
          order_id="1906948-512") 
<Response [200]>

update_order_status[source]

update_order_status(user:UserWithUserTokenBasedAuthentication, order_id:str, status:StatusOrder)

Update the status associated with the given order.

Note: Use get_order to get the next_status key. The next_status key is an array of valid next statuses for this order.

User Authentication needed.

Parameters:

user: user object (required)

order_id: string (required) -> The ID of the order you are fetching

status: string (required) -> The status of the Order you are updating.

# Example for usage of update_order_status

update_order_status(user=example_user, 
                    order_id="1906948-522", 
                    status=StatusOrder.payment_received) 
<Response [200]>

update_order_shipping[source]

update_order_shipping(user:UserWithUserTokenBasedAuthentication, order_id:str, shipping_cost:float)

Update the shipping costs associated with the given order.

Note: If the order status is neither cancelled, Payment Received, nor Shipped, you can change the shipping. Doing so will send an invoice to the buyer and set the order status to Invoice Sent.

User Authentication needed.

Parameters:

user: user object (required)

order_id: string (required) -> The ID of the order you are fetching

shipping_cost: number (required) -> The order shipping amount.

# Example for usage of update_order_shipping

update_order_shipping(user=example_user, 
                      order_id="1906948-516", 
                      shipping_cost=3.70) 
<Response [200]>

get_orders[source]

get_orders(user:UserWithUserTokenBasedAuthentication, status:Optional[StatusOrders]=None, page:Optional[int]=None, per_page:Optional[int]=None, sort:Optional[SortOptionsOrders]=None, sort_order:Optional[SortOrder]=None)

Get a list of orders associated with the given user.

Note: In the Discogs API is an optional parameter called "archived". I did not implement it because it always caused a server-sided crash.

User Authentication needed.

Parameters:

user: user object (required)

status: string (optional) -> Only show items with this status.

page: number (optional) -> The page you want to request.

per_page: number (optional) -> The number of items per page.

sort: string (optional) -> Sort items by this field.

sort_order: string (optional) -> Sort items in a particular order (one of asc, desc)

# Example for usage of get_orders

get_orders(user=example_user, 
           status=StatusOrders.payment_pending, 
           page=1, 
           per_page=3, 
           sort=SortOptionsOrders.created, 
           sort_order=SortOrder.asc) 
<Response [200]>

get_order_messages[source]

get_order_messages(user:UserWithUserTokenBasedAuthentication, order_id:str, page:Optional[int]=None, per_page:Optional[int]=None)

Get a list of messages associated with the given order, with the most recent first.

User Authentication needed.

Parameters:

user: user object (required)

order_id: string (required) -> The ID of the order you are fetching

page: number (optional) -> The page you want to request.

per_page: number (optional) -> The number of items per page.

# Example for usage of get_order_messages

get_order_messages(user=example_user, 
                   order_id="1906948-515", 
                   page=1, 
                   per_page=3) 
<Response [200]>

post_message_on_order[source]

post_message_on_order(user:UserWithUserTokenBasedAuthentication, order_id:str, message:str)

Post a new message to the given order.

User Authentication needed.

Parameters:

user: user object (required)

order_id: string (required) -> The ID of the order you are fetching

message: string (required)

# Example for usage of post_message_on_order

post_message_on_order(user=example_user, 
                      order_id="1906948-516", 
                      message="Hello World") 
<Response [201]>

Fee

get_discogs_fee_for_given_price[source]

get_discogs_fee_for_given_price(user:Union[UserWithoutAuthentication, UserWithUserTokenBasedAuthentication], price:float)

Calculate the fee for selling an item on the Marketplace in USD

Note: According to the Discogs API, it should be possible to change the currency. However, this feature seems to be broken at this point. That's why I did remove this optional argument.

No user Authentication needed.

Parameters:

user: user object (required)

price: number (required) -> The price to calculate a fee from

# Example for usage of get_discogs_fee_for_given_price

get_discogs_fee_for_given_price(user=example_user, 
                                price=5.42) 
<Response [200]>

Price Suggestions

get_price_suggestions[source]

get_price_suggestions(user:UserWithUserTokenBasedAuthentication, release_id:int)

Get a price suggestions for the given release id.

Note: Suggested prices will be denominated in the user’s selling currency. If no suggestions are available, an empty object will be returned.

User Authentication needed.

Parameters:

user: user object (required)

release_id: number (required) -> The release ID to calculate a price from.

# Example for usage of get_price_suggestions

get_price_suggestions(user=example_user, 
                      release_id=9453891) 
Converted 00_core.constants.ipynb.
Converted 01_core.discogs_user.ipynb.
Converted 02_core.rq_database.ipynb.
Converted 03_core.rq_marketplace.ipynb.
Converted 04_core.rq_inventory_export.ipynb.
Converted 05_core.rq_inventory_upload.ipynb.
Converted 06_core.rq_collection.ipynb.
Converted 07_core.rq_wantlist.ipynb.
Converted index.ipynb.