Document Properties
Kbid26052X
Last Modified23-Jun-2020
Added to KB09-Dec-2014
Public AccessEveryone
StatusOnline
Doc TypeReferences
Product
  • ICM 7.6
  • ICM 7.7
  • ICM 7.8
  • ICM 7.9
  • ICM 7.10

REST API - Add a payment to Customer profile


Note

Starting with 7.10 our REST API is documented using Redoc accessible at docs.intershop.com.

URI

/customers/-/payments

Http Method

POST

Short Description

Adds a payment method to the customer profile

Query Parameters

none

Example Requests

/customers/-/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

Description

Adds a payment to the customer profile of the logged in customer

Cartridge

app_sf_rest

ApplicationB2C Web Shop, SMB Web Shop

Product Version

7.5.1

Product To Version

 

Status

final

JSON

Request Data Format

application/json

Request related java object

com.intershop.sellside.rest.common.capi.resource.customer.payment.CustomerPaymentListResource
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": "33324324",
	"giftCardPIN": "1111"
}

or

{
  "name":"BPS_DEBIT_TRANSFER",
  "type":"Payment",
  "parameters":[
    {
      "key":"BankCode",
      "property":"12345678901"
    },
    {
      "key":"AccountNumber",
      "property":"123456789012345678"
    },
    {
      "key":"AccountHolder",
      "property":"Patricia Miller"
    }
  ]
}

Response Data Format

application/json

Response related java object

com.intershop.sellside.rest.common.capi.resource.customer.payment.CustomerPaymentListResource
com.intershop.component.rest.capi.resourceobject.LinkRO

Response Example

{
    "type": "Link",
    "uri": "PrimeTech-PrimeTechSpecials-Site/-/customers/-/payments/v74KDgAb8oEAAAFDMUOP8Ht5",
    "title": "BPS_CASH_ON_DELIVERY"
}

XML

XML Request Data Format

text/xml

XML Request Java Objects

com.intershop.sellside.rest.common.capi.resource.customer.payment.handler.CustomerPaymentHandler

com.intershop.sellside.rest.common.capi.resource.customer.payment.CustomerPaymentListResource
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>

XML Response Data Format

text/xml

XML Response Java Objects

com.intershop.sellside.rest.common.capi.resource.customer.payment.CustomerPaymentListResource
com.intershop.component.rest.capi.resourceobject.LinkRO

XML Response Example

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Link type="Link">
    <title>BPS_CASH_ON_DELIVERY</title>
    <uri>PrimeTech-PrimeTechSpecials-Site/-/customers/-/payments/KDMKDgAb1JYAAAFD3bKP8HsO</uri>
</Link>

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
Tickets