Add discount to cart
Principles
- Use a discount code for a cart, if applied the response will contain the code.
- Only one code per cart is allowed. Sending a new valid code will overwrite any existing code.
To remove any discount code that has been applied to the cart use:
curl --request PUT \
--url https://api.${env}.brinkcommerce.com/orderv1/carts \
--header 'authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzZXNzaW9uSWQiOiI3M2U3NTY3MS00NTUzLTRlODctYTkyYS01NGUwMDk0N2E2ZWIiLCJpYXQiOjE2MDA5NzIwMzEsImV4cCI6MTYwMTIzMTIzMX0.KZwLePY_3qC5RtsUzSAbCv30raHM0lUtm0QnGKS_UA4' \
--header 'content-type: application/json' \
--data '{
"deleteDiscount": true
}'
Next: Create order
Next we will look at how to create an order using Klarna Checkout