Menu
Add Payment Instrument To Basket
Add a payment instrument to a basket.
/organizations/{organizationId}/baskets/{basketId}/payment-instrumentsUse it in a workflow
- Add a step and choose the Salesforce Commerce Cloud connector.
- Pick the Add Payment Instrument To Basket action (under Shopper Baskets v1).
- Fill in the fields below, then reference the result from later steps as
{{addPaymentInstrumentToBasket.response.data}}.
Request
Path parameters
organizationIdstringrequiredAn identifier for the organization the request is being made by
basketIdstringrequiredThe ID of the basket to be modified.
Query parameters
siteIdstringrequiredThe identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
localeoneOfA descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
Request body
Enter the body as JSON in the step's Body field.
amountnumber (double)The payment transaction amount.
bankRoutingNumberstringThe bank routing number.
giftCertificateCodestringThe gift certificate code.
paymentCardanyThe payment card.
paymentMethodIdstringThe payment method ID.
{
"amount": 130.88,
"bankRoutingNumber": "12030000",
"giftCertificateCode": "AFGRTUZ",
"paymentCard": null,
"paymentMethodId": "CREDIT_CARD"
}
Response
Returns 200 with an object. Read it in later steps with {{addPaymentInstrumentToBasket.response.data.<field>}}.
adjustedMerchandizeTotalTaxnumber (double)The total tax on products in the shipment, including item-level price adjustments but not including service charges such as shipping. If the Discount Taxation preference is set to Tax Products and Shipping Only Based on Adjusted Price, this amount also includes prorated order-level price adjustments. It is read only.
adjustedShippingTotalTaxnumber (double)The total tax on shipping charges in the shipment, including shipping price adjustments. It is read only.
agentBasketbooleanIs the basket created by an agent? It is read only.
basketIdstringThe unique identifier for the basket. It is read only.
billingAddressanyThe billing address.
bonusDiscountLineItemsarray<object>The bonus discount line items.
bonusProductsarray<object>4 fieldsThe bonus products the customer can choose from.
couponCodestringThe coupon code that triggered the promotion, if applicable.
idstringThe ID of the line item. It is read only.
maxBonusItemsinteger (int32)The maximum number of bonus items the user can select for this promotion.
promotionIdstringThe ID of the promotion that triggered the creation of the line item.
channelTypestringThe sales channel. It is read only.
One ofstorefrontcallcentermarketplacedssstorepinteresttwitterfacebookadssubscriptionsonlinereservationcustomerservicecenterinstagramcommercetiktoksnapchatgooglewhatsappyoutube
couponItemsarray<object>The coupon items.
codestringrequiredThe coupon code.
couponItemIdanyThe coupon item ID. It is read only.
statusCodestringThe status of the coupon item. It is read only.
One ofcoupon_code_already_in_basketcoupon_code_already_redeemedcoupon_code_unknowncoupon_disabledredemption_limit_exceededcustomer_redemption_limit_exceededtimeframe_redemption_limit_exceededno_active_promotioncoupon_already_in_basketno_applicable_promotionappliedadhoc
validbooleanA flag indicating whether the coupon item is valid. A coupon line item is valid if the status code is "applied" or "no_applicable_promotion". It is read only.
creationDatestring (date-time)The timestamp when the basket was created. It is read only.
currencystringA three letter uppercase currency code conforming to the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard, or the string `N/A` indicating that a currency is not applicable.
customerInfoanyThe customer information, if the customer is logged in.
giftCertificateItemsarray<object>The gift certificate line items.
amountnumber (double)requiredThe gift certificate item amount.
giftCertificateItemIdanyThe item ID. It is read only.
messagestringThe gift certificate message.
recipientEmailstringrequiredThe recipient email.
recipientNamestringThe recipient's name.
senderNamestringThe sender's name.
shipmentIdstringThe ID of the shipment this item belongs to.
inventoryReservationExpirystring (date-time)The expiration datetime of the inventory reservation. It is read only.
lastModifiedstring (date-time)The timestamp when the basket was last modified. It is read only.
merchandizeTotalTaxnumber (double)The total products tax in the purchase currency. Merchandise total price represents the sum of the product prices before services (such as shipping) or adjustments from promotions have been added. It is read only.
orderPriceAdjustmentsarray<object>The order-level price adjustments.
appliedDiscountanyDetails describing the discount this price adjustment is based on. For adjustments not based on a discount, this value is null.
couponCodestringThe coupon code of the coupon this price adjustment is based on. For adjustments not based on a coupon, this value is null. It is read only.
createdBystringThe user who created the price adjustment. It is read only.
creationDatestring (date-time)The timestamp when the price adjustment was created. It is read only.
custombooleanA flag indicating whether this price adjustment was created by custom logic. This flag is set to true unless the price adjustment was created by the promotion engine.
itemTextstringThe text describing the item.
lastModifiedstring (date-time)The timestamp when the price adjustment was last modified. It is read only.
manualbooleanA flag indicating whether this price adjustment was created by a manual process. If the price adjustment was created by the promotion engine, this value is always false.
pricenumber (double)The adjustment price. It is read only.
priceAdjustmentIdanyThe price adjustment ID. It is read only.
promotionIdstringThe ID of the related promotion. Custom price adjustments can be assigned any promotion ID so long it is not used by a price adjustment belonging to the same item, and is not used by a promotion defined in the promotion engine. If not specified, a promotion ID is generated.
reasonCodestringThe reason for the price adjustment.
orderTotalnumber (double)The total price, including products, shipping and tax. It is read only.
paymentInstrumentsarray<object>The payment instruments list.
amountnumber (double)The payment transaction amount.
authorizationStatusanyThe authorization status of the payment transaction. It is read only.
bankRoutingNumberstringThe bank routing number.
maskedGiftCertificateCodestringThe gift certificate code with the last 4 characters not masked.
paymentCardanyThe payment card.
paymentInstrumentIdanyThe payment instrument ID. It is read only.
paymentMethodIdstringThe payment method ID. It is read only.
productItemsarray<object>The product items.
adjustedTaxnumber (double)The tax on the line item, including any adjustments. It is read only.
basePricenumber (double)The base price of the line item, which is the unit price not including adjustments. If the taxation policy is net, it doesn't include tax. If the taxation policy is gross, it includes tax. It is read only.
bonusDiscountLineItemIdstringThe ID of the bonus discount line item this bonus product relates to. It is read only.
bonusProductLineItembooleanA flag indicating whether the product item is a bonus.
bundledProductItemsarray<object>The bundled product items.
giftbooleanReturns true if the item is a gift. It is read only.
giftMessagestringThe gift message.
inventoryIdstringThe inventory list ID associated with this item.
itemIdanyThe product item ID. Use it to identify this item when updating its quantity or creating a custom price adjustment for it. It is read only.
itemTextstringThe text describing the item.
optionItemsarray<object>27 fieldsThe option items.
pricenumber (double)The price of the line item before applying any adjustments. If the line item is based on net pricing then the net price is returned. If the line item is based on gross pricing then the gross price is returned. It is read only.
priceAdjustmentsarray<object>12 fieldsThe price adjustments.
priceAfterItemDiscountnumber (double)The price of the product line item including item-level adjustments, but not including order-level adjustments or shipping charges. If the taxation policy is net, it doesn't include tax. If the taxation policy is gross, it includes tax. It is read only.
priceAfterOrderDiscountnumber (double)The price of the product line item including item-level adjustments and prorated order-level adjustments, but not including shipping charges. If the taxation policy is net, it doesn't include tax. If the taxation policy is gross, it includes tax. It is read only.
productIdstringThe ID of the product.
productListItemanyIf this product line item was added from a product list, this value is a reference to the corresponding product list item.
productNamestringThe name of the product.
qualifyingProductItemIdstringReturns the id of the ProductLineItem that qualified the basket for this bonus product. This method is only applicable if the product line item is a bonus product line item, and if the promotion is a product promotion with number of qualifying products granting a bonus-product discount. If these conditions aren't met, the method returns null. If there are multiple product line items that triggered this bonus product, this method returns the last one by position within the order.
quantitynumber (double)The quantity of the products represented by this item.
shipmentIdstringThe ID of the shipment this item belongs to.
shippingItemIdstringIf the product line item has a related shipping item, this value is its ID. A related shipping item represents a surcharge applied to individual products using a particular shipping method. It is read only.
taxnumber (double)The tax for the product item, not including price adjustments. It is read only.
taxBasisnumber (double)The price used to calculate the tax for this product item. It is read only.
taxClassIdstringThe tax class ID for the product item, or null if no tax class ID is associated with the product item. It is read only.
taxRatenumber (double)The tax rate, which is the decimal tax rate to be applied to the product represented by this item. It is read only.
productSubTotalnumber (double)The total price of all products including item-level adjustments, but not including order-level adjustments or shipping charges. If the taxation policy is net, it doesn't include tax. If the taxation policy is gross, it includes tax. It is read only.
productTotalnumber (double)The total price of all products including adjustments, but not including shipping charges. If the taxation policy is net, it doesn't include tax. If the taxation policy is gross, it includes tax. It is read only.
shipmentsarray<object>The shipments.
adjustedMerchandizeTotalTaxnumber (double)The total tax on products in the shipment, including item-level price adjustments but not including service charges such as shipping. If the Discount Taxation preference is set to Tax Products and Shipping Only Based on Adjusted Price, this amount also includes prorated order-level price adjustments. It is read only.
adjustedShippingTotalTaxnumber (double)The total tax on shipping charges in the shipment, including shipping price adjustments. It is read only.
giftbooleanA flag indicating whether the shipment is a gift. It is read only.
giftMessagestringThe gift message.
merchandizeTotalTaxnumber (double)The total tax on products in the shipment, not including price adjustments or service charges such as shipping. It is read only.
productSubTotalnumber (double)The total price of all products in the shipment, including item-level adjustments, but not including order-level adjustments or shipping charges. If the taxation policy is net, it doesn't include tax. If the taxation policy is gross, it includes tax. It is read only.
productTotalnumber (double)The total price of all products in the shipment including item-level adjustments and prorated order-level adjustments, but not including shipping charges. If the taxation policy is net, it doesn't include tax. If the taxation policy is gross, it includes tax. It is read only.
shipmentIdanyThe order-specific ID of the shipment. The default value is 'me'.
Default "me"
shipmentNostringThe shipment number of this shipment. This number is automatically generated. It is read only.
shipmentTotalnumber (double)The total price of all products in the shipment including item-level adjustments, shipping charges, and tax. It is read only.
shippingAddressanyThe shipping address.
shippingMethodobject6 fieldsDocument representing a shipping method.
shippingStatusstringThe shipping status of the shipment.
One ofnot_shippedshipped
shippingTotalnumber (double)The total price of all shipping charges in the shipment, including shipping adjustments. If the taxation policy is net, it doesn't include tax. If the taxation policy is gross, it includes tax. It is read only.
shippingTotalTaxnumber (double)The total tax on shipping charges in the shipment, not including shipping price adjustments. It is read only.
taxTotalnumber (double)The total tax on the shipment, including item-level price adjustments and service charges such as shipping. If the Discount Taxation preference is set to Tax Products and Shipping Only Based on Adjusted Price, this amount also includes prorated order-level price adjustments. It is read only.
trackingNumberstringThe tracking number of the shipment.
shippingItemsarray<object>The shipping items.
adjustedTaxnumber (double)The tax for the shipping item, including price adjustments. It is read only.
basePricenumber (double)The base price of the shipping item, which is the unit price not including adjustments. If the taxation policy is net, it doesn't include tax. If the taxation policy is gross, it includes tax. It is read only.
itemIdstringThe shipping item ID. Use it to identify this shipping item when updating its quantity or creating a custom price adjustment for it. It is read only.
itemTextstringThe text describing the shipping item.
pricenumber (double)The price of the line item before applying any adjustments. If the line item is based on net pricing then the net price is returned. If the line item is based on gross pricing then the gross price is returned. It is read only.
priceAdjustmentsarray<object>12 fieldsThe price adjustments.
priceAfterItemDiscountnumber (double)The price of the shipping item including item-level adjustments, but not including order-level adjustments or shipping charges. If the taxation policy is net, it doesn't include tax. If the taxation policy is gross, it includes tax. It is read only.
shipmentIdanyThe identifier of the shipment to which this item belongs.
taxnumber (double)The tax on the product item, not including adjustments. It is read only.
taxBasisnumber (double)The price used to calculate the tax for this shipping item. It is read only.
taxClassIdstringThe tax class ID for the product item, or null if no tax class ID is associated with the product item. It is read only.
taxRatenumber (double)The tax rate applicable to this product line item. For a 10% tax rate, the value is 0.1. It is read only.
shippingTotalnumber (double)The total price of all shipping charges, including shipping adjustments. If the taxation policy is net, it doesn't include tax. If the taxation policy is gross, it includes tax. It is read only.
shippingTotalTaxnumber (double)The total tax on all shipping charges, not including shipping adjustments. It is read only.
sourceCodestringThe source code assigned to the basket. It is read only.
taxTotalnumber (double)The total tax amount. It is read only.
taxationstringThe taxation policy (gross or net). It is read only.
One ofgrossnet
{
"adjustedMerchandizeTotalTax": 4.95,
"adjustedShippingTotalTax": 0.3,
"agentBasket": true,
"basketId": "e78aa5646a8efebdd9cdd38be7",
"billingAddress": null,
"bonusDiscountLineItems": [
{
"bonusProducts": [
{
"productId": "apple-ipod-classic",
"productDescription": "Nintendo DS revolutionizes handheld gameplay.",
"productName": "Nintendo DS Game Console",
"title": "Nintendo DS Game Console"
}
],
"couponCode": "5ties",
"id": "91f4dd8bfa0653d58b7783b04f",
"maxBonusItems": 0,
"promotionId": "Buy1Get2"
}
],
"channelType": "storefront",
"couponItems": [
{
"code": "5ties",
"couponItemId": null,
"statusCode": "no_applicable_promotion",
"valid": true
}
],
"creationDate": "2015-05-19T15:23:18.000Z",
"currency": "USD",
"customerInfo": null,
"giftCertificateItems": [
{
"amount": 20,
"recipientEmail": "no-reply@salesforce.com",
"giftCertificateItemId": null,
"message": "Birthday present.",
"recipientName": "Daniel Mustermann",
"senderName": "Max Mustermann",
"shipmentId": "me"
}
]
}
Need more? See the Salesforce Commerce Cloud guide for connection setup and behaviour shared by every action.