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

Converting basket to order

In order to convert basket to order the following properties should be provided on the request body:

  • BasketId
  • PaymentMethodId
  • PriceGroupId
  • CultureCode

An example could be:

    
        curl -D- -X POST https://ucommerce-headless-backend.azurewebsites.net/api/v1/payments \
            -H 'Authorization: Bearer <ACCESS_TOKEN>' 
            -H 'Content-Type: application/json' \
            -d '{
                    "basketId": "afd095a8-6215-4daf-a813-60f27f01c7b7",
                    "paymentMethodId": "ede4ebf7-f70d-4623-b58b-22a38be803b9",
                    "priceGroupId": "878b0ff1-0800-40ac-b006-0e9858f234a5",
                    "cultureCode": "en-US"
                }'
    

If you get a successful response, the newly created paymentId and paymentUrl will be returned back to you. You have to follow the paymentUrl and walk through the payment flow.

Example:

    
    {
      "paymentId": "string",
      "paymentUrl": "string"
    }
    

Possible errors that may occur:

Error Description
BadRequest (400) Execution of the pipeline fails; Billing address is missing from the order; Basket does not below to Store; etc.
Unauthorized (401) The token expires
Forbidden (403) The token does not have access to this endpoint

Example:

    
    {
        "errors": [
            {
                "error-description": "Billing address is missing from the order.",
                "error": "BadRequest"
            }
        ]
    }
    

See Handling failures for more info.