AlphaAlpha Docs

Cart

API calls concerning carts

Delete by list of ids in current tenant

DELETE
/carts/{tenantId}
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X DELETE "http://localhost:18080/api/v1/carts/{tenantId}" \  -H "Content-Type: application/json" \  -d '[    "string"  ]'
Empty
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}

Find by list of ids in current tenant

GET
/carts/{tenantId}/find
AuthorizationBearer <token>

In: header

Query Parameters

ids*array<>

Response Body

application/json

application/json

application/json

application/json

curl -X GET "http://localhost:18080/api/v1/carts/{tenantId}/find?ids=string"
[
  {
    "created": "2019-08-24T14:15:22Z",
    "createdBy": "string",
    "id": "string",
    "items": [
      {
        "productId": "string",
        "quantity": 0.1
      }
    ],
    "tenantId": "string",
    "updated": "2019-08-24T14:15:22Z",
    "updatedBy": "string",
    "userId": "string"
  }
]
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}

Find all for current tenant

GET
/carts/{tenantId}/find-all
AuthorizationBearer <token>

In: header

Response Body

application/json

application/json

application/json

application/json

curl -X GET "http://localhost:18080/api/v1/carts/{tenantId}/find-all"
[
  {
    "created": "2019-08-24T14:15:22Z",
    "createdBy": "string",
    "id": "string",
    "items": [
      {
        "productId": "string",
        "quantity": 0.1
      }
    ],
    "tenantId": "string",
    "updated": "2019-08-24T14:15:22Z",
    "updatedBy": "string",
    "userId": "string"
  }
]
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}

Find by id in current tenant

GET
/carts/{tenantId}/find/{id}
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Response Body

application/json

application/json

application/json

application/json

curl -X GET "http://localhost:18080/api/v1/carts/{tenantId}/find/string"
{
  "created": "2019-08-24T14:15:22Z",
  "createdBy": "string",
  "id": "string",
  "items": [
    {
      "productId": "string",
      "quantity": 0.1
    }
  ],
  "tenantId": "string",
  "updated": "2019-08-24T14:15:22Z",
  "updatedBy": "string",
  "userId": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}

Get page by page number and size with optional sorting based on field to sortBy and direction

GET
/carts/{tenantId}/page
AuthorizationBearer <token>

In: header

Query Parameters

pageNumber?integer
Formatint32
pageSize?integer
Formatint32
sortBy?string
direction?string
Value in"ASC" | "DESC"
search?string

Response Body

application/json

application/json

application/json

application/json

curl -X GET "http://localhost:18080/api/v1/carts/{tenantId}/page"
{
  "content": [
    {
      "created": "2019-08-24T14:15:22Z",
      "createdBy": "string",
      "id": "string",
      "items": [
        {
          "productId": "string",
          "quantity": 0.1
        }
      ],
      "tenantId": "string",
      "updated": "2019-08-24T14:15:22Z",
      "updatedBy": "string",
      "userId": "string"
    }
  ],
  "empty": true,
  "first": true,
  "last": true,
  "number": 0,
  "numberOfElements": 0,
  "pageable": {
    "offset": 0,
    "pageNumber": 0,
    "pageSize": 0,
    "paged": true,
    "sort": {
      "empty": true,
      "sorted": true,
      "unsorted": true
    },
    "unpaged": true
  },
  "size": 0,
  "sort": {
    "empty": true,
    "sorted": true,
    "unsorted": true
  },
  "totalElements": 0,
  "totalPages": 0
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}

Get or create cart

GET
/carts/{tenantId}/{cartId}
AuthorizationBearer <token>

In: header

Path Parameters

cartId*string
tenantId*string

Response Body

application/json

application/json

application/json

application/json

curl -X GET "http://localhost:18080/api/v1/carts/string/string"
{
  "created": "2019-08-24T14:15:22Z",
  "createdBy": "string",
  "id": "string",
  "items": [
    {
      "productId": "string",
      "quantity": 0.1
    }
  ],
  "tenantId": "string",
  "updated": "2019-08-24T14:15:22Z",
  "updatedBy": "string",
  "userId": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}

Add to cart

POST
/carts/{tenantId}/{cartId}/add
AuthorizationBearer <token>

In: header

Path Parameters

cartId*string
tenantId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "http://localhost:18080/api/v1/carts/string/string/add" \  -H "Content-Type: application/json" \  -d '{    "productId": "string",    "quantity": 0.1  }'
{
  "created": "2019-08-24T14:15:22Z",
  "createdBy": "string",
  "id": "string",
  "items": [
    {
      "productId": "string",
      "quantity": 0.1
    }
  ],
  "tenantId": "string",
  "updated": "2019-08-24T14:15:22Z",
  "updatedBy": "string",
  "userId": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}

Checkout

POST
/carts/{tenantId}/{cartId}/checkout
AuthorizationBearer <token>

In: header

Path Parameters

cartId*string
tenantId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "http://localhost:18080/api/v1/carts/string/string/checkout" \  -H "Content-Type: application/json" \  -d '{    "city": "string",    "country": "string",    "email": "user@example.com",    "firstName": "string",    "lastName": "string",    "postalCode": "string",    "street": "string"  }'
{
  "created": "2019-08-24T14:15:22Z",
  "createdBy": "string",
  "id": "string",
  "items": [
    {
      "productId": "string",
      "quantity": 0.1
    }
  ],
  "tenantId": "string",
  "updated": "2019-08-24T14:15:22Z",
  "updatedBy": "string",
  "userId": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}

Get products

GET
/carts/{tenantId}/{cartId}/products
AuthorizationBearer <token>

In: header

Path Parameters

cartId*string
tenantId*string

Response Body

application/json

application/json

application/json

application/json

curl -X GET "http://localhost:18080/api/v1/carts/string/string/products"
{
  "items": [
    {
      "amount": 0.1,
      "product": {
        "category": "string",
        "currency": "string",
        "description": "string",
        "id": "string",
        "name": "string",
        "price": 0.1,
        "supplier": "string",
        "thumbnail": {
          "blobId": "string",
          "created": "2019-08-24T14:15:22Z",
          "extension": "string",
          "fileSize": 0,
          "name": "string",
          "type": "IMAGE"
        }
      }
    }
  ]
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}

Remove from cart

POST
/carts/{tenantId}/{cartId}/remove
AuthorizationBearer <token>

In: header

Path Parameters

cartId*string
tenantId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "http://localhost:18080/api/v1/carts/string/string/remove" \  -H "Content-Type: application/json" \  -d '{    "productId": "string",    "quantity": 0.1  }'
{
  "created": "2019-08-24T14:15:22Z",
  "createdBy": "string",
  "id": "string",
  "items": [
    {
      "productId": "string",
      "quantity": 0.1
    }
  ],
  "tenantId": "string",
  "updated": "2019-08-24T14:15:22Z",
  "updatedBy": "string",
  "userId": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}

Delete by id in current tenant

DELETE
/carts/{tenantId}/{id}
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Response Body

application/json

application/json

application/json

curl -X DELETE "http://localhost:18080/api/v1/carts/{tenantId}/string"
Empty
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}