Documentation

Ucommerce includes full API reference documentation and lots of helpful articles to help you build your e-commerce site as effortlessly as possible.

Topics Payment Providers
v7.18

Creating a basket

The first thing you need to do is to attach your AccessToken token to the request's header. See Quick Start if you are not sure how to do that.

To create new basket your request should have a body with:

  • CultureCode
  • Currency

An example could be:

    
        curl -D- -X POST https://umbracodemo1.ucommerce.net/api/v1/baskets \
            -H 'Authorization: Bearer <ACCESS_TOKEN>' 
            -H 'Content-Type: application/json' \
            -d '{
                    "cultureCode": "en-US",
                    "currency": "DKK"
                }'
    

If you get a successful response, the newly created basketId will be returned back to you.

Example:

    
    {
        "basketId": "afd095a8-6215-4daf-a813-60f27f01c7b7"
    }
    

Possible errors that may occur:

Error Description
BadRequest (400) Product Catalog does not exist; Currency does not exist; Execution of the pipeline fails
Unauthorized (401) The token expires
Forbidden (403) The token does not have access to this endpoint

Example:

    
    {
        "errors": [
            {
                "error-description": "Currency does not exist.",
                "error": "BadRequest"
            }
        ]
    }
    

See Handling failures for more info.