Related Documents
Document Properties
Kbid25K439
Last Modified23-Jun-2020
Added to KB20-Dec-2013
Public AccessEveryone
StatusOnline
Doc TypeReferences

REST API - Add Payment to basket (until 7.4 CI)

URI

/baskets/<basket-id>/payments

Http Method

POST

Short Description

Adds a payment method to the basket

Query Parameters

none

Example Requests

/baskets/W1oKDgAbKPwAAAFDeTyXcGaV/payments

HTTP Status Codes

201 Created
400 Bad Request
Possible values for header 'error-key':

  • shopping_cart.payment.paymentdata.error (e.g. wrong giftcard number)
  • shopping_cart.payment.missing_fields.error
  • shopping_cart.payment.invalid_fields.error
  • shopping_cart.payment.name.error (Payment method not found)
  • shopping_cart.payment.dublicate.error

401 Unauthorized
403 Forbidden
404 Not found (Basket)
Possible values for header 'error-key':

  • basket.basket_not_found.error

Description

Adds a payment method to the basket. If the user is logged in a registered payment method can be referenced via ID (for payments that have been created with POST /customers/-/payments)

Cartridge

app_sf_rest

Application

B2C Web Shop, SMB Web Shop

Product Version

7.4

Product To Version

7.4.6

Status

final

JSON

Request Data Format

application/json

Request related java object

com.intershop.sellside.rest.common.capi.resource.basket.BasketPaymentResource
com.intershop.sellside.rest.common.capi.resourceobject.basket.PaymentRO

Request Example

Simple payment method without attributes:

{
	"name": "BPS_CASH_ON_DELIVERY",
	"type": "Payment"
}

or

{
	"name": "BPS_ONLINEPAY",
	"type": "Payment"
}

or

{
	"name": "BPS_INVOICE",
	"type": "Payment"
}

etc.

Add complex payment methods with all attributes:

{
	"name": "BPS_GIFT_CARD",
	"type": "Payment",
	"giftCardNumber": "11111111111",
	"giftCardPIN": "1111"
}

or

{
	"name": "BPS_DEBIT_TRANSFER",
	"type": "Payment",
	"accountNumber": "123456789",
	"accountHolder": "Patricia Miller",
	"bankCode": "83053030"
}

Add complex payment methods that have been registered to customer:

{
	"name": "BPS_GIFT_CARD",
	"type": "Payment",
	"id": "sGHHGdfgbdgdgHGHhghasedl"
}

or

{
	"name": "BPS_DEBIT_TRANSFER",
	"type": "Payment",
	"id": "wRIKDgAbhZIAAAFDY4iXcGez"
}

Response Data Format

Response related java object

n/a

Response Example

n/a

XML

XML Request Data Format

text/xml

XML Request Java Objects

com.intershop.sellside.rest.common.capi.resource.basket.BasketPaymentResource
com.intershop.sellside.rest.common.capi.resourceobject.basket.PaymentRO

XML Request Example

Simple payment method without attributes:

<Payment name="BPS_CASH_ON_DELIVERY" type="Payment" />

or

<Payment name="BPS_ONLINEPAY" type="Payment" />

or

<Payment name="BPS_INVOICE" type="Payment" />

etc.

Add complex payment methods with all attributes:

<Payment name="BPS_GIFT_CARD" type="Payment">
	<giftCardNumber>11111111111</giftCardNumber>
	<giftCardPIN>1111</giftCardPIN>
</Payment>

or

<Payment name="BPS_DEBIT_TRANSFER" type="Payment">
	<accountNumber>123456789</accountNumber>
	<accountHolder>Patricia Miller</accountHolder>
	<bankCode>83053030</bankCode>
</Payment>

Add complex payment methods that have been registered to customer:

<Payment name="BPS_GIFT_CARD" type="Payment">
	<id>sGHHGdfgbdgdgHGHhghasedl</id>
</Payment>

or

<Payment name="BPS_DEBIT_TRANSFER" type="Payment">
	<id>wRIKDgAbhZIAAAFDY4iXcGez</id>
</Payment>

XML Response Data Format

XML Response Java Objects

n/a

XML Response Example

n/a

Disclaimer

The information provided in the Knowledge Base may not be applicable to all systems and situations. Intershop Communications will not be liable to any party for any direct or indirect damages resulting from the use of the Customer Support section of the Intershop Corporate Web site, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.

Customer Support
Knowledge Base
Product Resources
Support Tickets