Skip to main content
POST
/
basket-items
Add To Basket
curl --request POST \
  --url https://api.nuwebgroup.com/v1/basket-items \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "basketId": 1,
  "autocomplete": false,
  "paymentMethod": null,
  "source": {
    "type": "order_item",
    "id": "JF43HSDJ2KDN"
  },
  "items": [
    {
      "id": 8,
      "quantity": 3
    },
    {
      "id": "92",
      "amount": 3450
    }
  ]
}
'
{
  "id": 5,
  "currencyId": 1,
  "currencySymbol": "Ā£",
  "currencyCode": "GBP",
  "hasExpired": false,
  "expiresAt": "2021-01-13T11:03:55.000000Z",
  "expiresAtMilliseconds": 1610535835,
  "items": [],
  "orderItems": [],
  "count": 0,
  "totalExTax": 0,
  "discount": null,
  "tax": 0,
  "taxBreakdown": [],
  "total": 0,
  "totalDeferred": 0,
  "hasTaxes": false,
  "hasDiscounts": false,
  "hasDeferredPayments": false
}

Authorizations

Authorization
string
header
required

The 'Bearer' token can be obtained from the token management interface or via the login endpoint using your admin user credentials.

Headers

X-NU-SALES-CHANNEL-PRICING
enum<string>

This header will determine which sales channel pricing to use in the request. When omitted, the default behaviour is to use box office pricing. This only influences the pricing, not the sales channel that is recorded against the items.

Available options:
shop,
kiosk,
box_office

Body

application/json

Request body for adding an item to the basket

basketId
integer

The basket ID in which the item is being added to. If this is not present, a new basket will be created. Basket IDs and Order IDs can be used interchangeably. If this field is present then customerId, customerName and customerEmail fields will be ignored.

currencyId
integer

The ID of the currency to use to process this basket addition. If providing a basket ID, this field will be ignored. The currency ID specified must be enabled for this company.

customerId
integer

The item(s) will be added to this customer's basket. If this customer does not have a basket then a new one will be created. If a customer can be found using this then customerName and customerEmail will be ignored. This is required where the payment method is ewallet-online.

customerName
string

This will be used in combination with customerEmail to detemine the basket to add items to. If this customer does not have a basket then a new one will be created. If a customer cannot be found then a new one will be created.

customerEmail
string

This will be used in combination with customerName to detemine the basket to add items to. If this customer does not have a basket then a new one will be created. If a customer cannot be found then a new one will be created.

customerSsoId
string

This will be used in combination with customerName + customerEmail OR customerId. Single sign-on identifier for the customer, optional & only applicable to companies using a custom SSO solution.

successRedirectUrl
string

If this basket is activated in the shop, the customer will be redirected to this URL after completing checkout.

failureRedirectUrl
string

If this basket is activated in the shop, the customer will be redirected to this URL after a checkout failure

items
object[]

The items being added to the basket

paymentSplits
object[]

Breakdown of payments when using the 'split' payment method. The sum of all splits must equal the order total.

autocomplete
boolean

When true, this allows you to auto-generate and complete an order from the newly created basket.

cancelExistingBasket
boolean

When true, if a basketId is supplied, that basket will be expired and a new basketId will be issued. Without a basketId, this parameter is ignored.

uuid
boolean

When used with autocomplete, the UUID will be used as an idempotency key to ensure that the same order is not created more than once due to network failure. This should not be used to add items to a persisted basket across multiple requests.

paymentMethod
enum<string>

The payment method used if the autocomplete flag is set to true.

Available options:
card-not-present-offline,
card-not-present-online,
card-present-offline,
card-present-online,
cash,
complimentary,
bank,
ewallet-online,
cheque,
gift-card,
money-order,
split
inhibitConfirmationEmail
boolean

Disable order confirmation email. Only applicable when autocomplete is set to true.

include
enum<string>[]

A list of related resources you wish to include in the response. Values can be a url encoded array, or comma separated string.

Available options:
wallet
source
object

If completing an e-wallet payment, you must provide the source.

generateBasketUrl
boolean

When set to true, a startBasketUrl attribute will be returned, which will include a URL to initiate the basket flow in shop for the newly created basket.

Response

Successfully added item to existing basket.

id
integer
currencyId
integer
currencySymbol
string
currencyCode
string
hasExpired
boolean
expiresAt
string
expiresAtMilliseconds
integer
items
any[]
orderItems
any[]
count
integer
totalExTax
integer
discount
integer
tax
integer
taxBreakdown
any[]
total
integer
totalDeferred
integer
hasTaxes
boolean
hasDiscounts
boolean
hasDeferredPayments
boolean