Cart

The cart API is used to manipulate the user’s cart. The cart API is an OAuth-based service–as such, it expects that the proper OAuth tokens are sent to it.

View Cart

GET /cart/1/

Required Parameters:
  • sourceType (string): The source of the calling application. This string is an internal identifier for beaport.
Optional Parameters:
  • summary (boolean: true|false): If summary is true, only counts (no items) are returned
  • name (string): The name of the cart to retrieve

Add Items to Cart

POST /cart/1/

Required Parameters:
  • sourceType (string): The source of the calling application. This string is an internal identifier for beaport.
  • items (string/JSON): A JSON-formatted list of items to add (for example: [{“id”:700000, “type”:”track”, “audioFormat”:”mp3”}, {“id”:70001, “type”:”release”, “audioFormat”:”wav”}])
Optional Parameters:
  • name (string): The name of the cart to add the items to you
  • alreadyPurchasedOverride (boolean: true|false): When an item has already been purchased by a user in the past, a warning message will be returned. Re-submit the request with alreadyPurchasedOverride=true to add the item anyway.

Change Cart Audio Format

PUT /cart/1/

Required Parameters:
  • sourceType (string): The source of the calling application. This string is an internal identifier for beaport.
  • audioFormat (string): The audio format to change every item in the cart to (mp3, wav, aiff, etc.)
Optional Parameters:
  • name (string): The name of the cart to change the audio format of

Change Cart Item Audio Formats

PUT /cart/1/

Required Parameters:
  • sourceType (string): The source of the calling application. This string is an internal identifier for beaport.
  • items (string/JSON): A JSON-formatted list of items to change the format for (for example: [{“id”:700000, “type”:”track”, “audioFormat”:”wav”}, {“id”:70001, “type”:”release”, “audioFormat”:”aiff”}])
Optional Parameters:
  • name (string): The name of the cart to change the audio format of items for

Empty Cart

DELETE /cart/1/

Required Parameters:
  • sourceType (string): The source of the calling application. This string is an internal identifier for beaport.
Optional Parameters:
  • name (string): The name of the cart to delete/empty

Remove Items From Cart

DELETE /cart/1/

Required Parameters:
  • sourceType (string): The source of the calling application. This string is an internal identifier for beaport.
  • items (string/JSON): A JSON-formatted list of items to delete (for example: [{“id”:700000, “type”:”track”}, {“id”:70001, “type”:”release”}])
Optional Parameters:
  • name (string): The name of the cart to delete items from

Examples

View the cart:

GET http://api.beatport.com/cart/1/?sourceType=store

Add two items:

POST http://api.beatport.com/cart/1/?sourceType=store&items=[{"id":700000, "type":"track", "audioFormat":"mp3"}, {"id":70001, "type":"release", "audioFormat":"wav"}]

Change the audio format of everything to mp3:

PUT http://api.beatport.com/cart/1/?audioFormat=mp3&sourceType=store

Change the audio format of a track to aiff:

PUT http://api.beatport.com/cart/1/?sourceType=store&items=[{"id":700000, "type":"track", "audioFormat":"aiff"}]

Delete an item:

DELETE http://api.beatport.com/cart/1/?sourceType=store&items=[{"id":70001, "type":"release"}]

Empty the cart:

DELETE http://api.beatport.com/cart/1/?sourceType=store

Table Of Contents

Previous topic

Beatport API Documentation

Next topic

Object Structures

This Page