Buyback Cart API

Use these APIs to create, manage and submit buyback orders with ValoreBooks.

Routes

https://test.valorebooks.com/marketplace/buyback/cart (qa)
https://api.valorebooks.com/marketplace/buyback/cart (production)

POST Create a new cart to add items to

Parameters

Name Located in Description Type
Content-Type header String

Responses

200 Details about your newly created buyback list
{
  "id": 123,
  "state": "ACTIVE",
  "items": []
}
403 Your AWS credentials are not correct
No user found with given credentials.
No seller found with given credentials.
500 An internal error occurred

https://test.valorebooks.com/marketplace/buyback/cart/{id} (qa)
https://api.valorebooks.com/marketplace/buyback/cart/{id} (production)

GET Retrieve a list of all the items currently in your cart

Parameters

Name Located in Description Type
Content-Type header String
id path Id of the buyback cart String

Responses

200 Details about your cart and items
{
  "id": 60,
  "status": "ACTIVE",
  "items": [
    {
      "id": 69,
      "isbn": "9781305577213",
      "price": 39.35,
      "status": "LOCKED"
    },
    {
      "id": 68,
      "isbn": "9780321356680",
      "price": 11.28,
      "status": "LOCKED"
    },
    {
      "id": 67,
      "isbn": "9781118771334",
      "price": 9.25,
      "status": "UNLOCKED"
    }
  ]
}
403 Your AWS credentials are not correct
No user found with given credentials.
No seller found with given credentials.
404 Not found
No cart found with given id
500 An internal error occurred

https://test.valorebooks.com/marketplace/buyback/cart/{id}/checkout (qa)
https://api.valorebooks.com/marketplace/buyback/cart/{id}/checkout (production)

POST Complete the checkout and create orders for the items in your cart

Parameters

Name Located in Description Type
Content-Type header String
id path Id of the cart you want to checkout String

Responses

200 Details about your order
{
  "orderId": 2544953,
    "cartTotal": 59.88,
    "items": [
      {
        "id": 6050209,
        "isbn": "9781305577213",
        "price": 39.35
      },
      {
        "id": 6050210,
        "isbn": "9780321356680",
        "price": 11.28
      },
      {
        "id": 6050211,
        "isbn": "9781118771334",
        "price": 9.25
      }
    ]
}
400 There was an error with your request
Cannot checkout cart `id` because it is not active
403 Your AWS credentials are not correct
No user found with given credentials.
No seller found with given credentials.
404 Not found
Cannot find a buyback cart for id `id`
409 There was a confilict with your request
Cannot checkout cart `id` because an item became unavailable
500 An internal error occurred

https://test.valorebooks.com/marketplace/buyback/cart/{cartId}/item/{itemId} (qa)
https://api.valorebooks.com/marketplace/buyback/cart/{cartId}/item/{itemId} (production)

DELETE Remove an item from your cart

Parameters

Name Located in Description Type
Content-Type header String
cartId path Id of cart the item will be removed from Long
itemId path Id of item that will be removed from the cart Long

Responses

200 Success
400 There was an error with your request
Missing or invalid `itemId` parameter.
Missing or invalid `cartId` parameter.
Given cart id does not match the cart this item belongs to.
This cart has already completed its transaction.
This cart is currently completing its transaction.
403 Your AWS credentials are not correct
No user found with given credentials.
No seller found with given credentials.
404 Not found
Cannot find a buyback cart for id `id`
500 An internal error occurred

https://test.valorebooks.com/marketplace/buyback/cart/{id}/item (qa)
https://api.valorebooks.com/marketplace/buyback/cart/{id}/item (production)

POST Add an item to your cart

Parameters

Name Located in Description Type
Content-Type header String
id path Id of cart the item will be added to Long
isbn body ISBN of item that will be added to the cart String

Request Examples

{
  "isbn": 9781234567890
}

Responses

200 Details about the cart with the newly added item
{
  "id": 60,
  "status": "ACTIVE",
  "items": [
    {
      "id": 69,
      "isbn": "9781305577213",
      "price": 39.35,
      "status": "LOCKED"
    },
    {
      "id": 68,
      "isbn": "9780321356680",
      "price": 11.28,
      "status": "LOCKED"
    },
    {
      "id": 67,
      "isbn": "9781118771334",
      "price": 9.25,
      "status": "UNLOCKED"
    }
  ]
}
400 There was an error with your request
Missing or invalid `id` parameter.
Given cart id does not match the cart this item belongs to.
This cart has already completed its transaction.
This cart is currently completing its transaction.
403 Your AWS credentials are not correct
No user found with given credentials.
No seller found with given credentials.
404 Not found
No cart found with given id
500 An internal error occurred