addPayments

post

/ccstore/v1/payment

Add Payments. Add payments to an order.

Request

Supported Media Types
  • application/json
Body Parameter
Root Schema : addPayments_request
Nested Schema : payments
Type: array
The array of Payments to be applied to the order.
Nested Schema : items
Type: object
Nested Schema : billingAddress
Type: object
The billing address details.
Nested Schema : customProperties
Type: object
Custom object with dynamic properties. This will be passed to the webhook request

Response

Supported Media Types
  • application/json
200 Response
Following model is returned when operation succeeds.
Body
Root Schema : addPayments_response
Nested Schema : paymentResponses
Type: array
The array of payment responses
Nested Schema : items
Type: object
Nested Schema : customPaymentProperties
Type: object
Custom Payment Properties
Example application/json

{
    "customPaymentProperties":{
        "sample-addnl-property-key2":"sample-payment-property-value2",
        "cust-prop2":"cust-prop2",
        "cust-prop1":"cust-prop1"
    },
    "orderId":"o50419",
    "profileId":"110093",
    "amountRemaining":55,
    "links":[
        {
            "rel":"self",
            "href":"http://localhost:8080/ccstoreui/v1/payment"
        }
    ],
    "paymentResponses":[
        {
            "paymentGroupId":"pg50414",
            "amount":55,
            "gatewayName":"PP-A",
            "uiIntervention":"REDIRECT",
            "paymentMethod":"onlinePaymentGroup",
            "transaction_state":"created",
            "id":"PAY-48G29628SF768135MLCM36QI",
            "paymentState":"INITIAL",
            "type":"paypalCheckout",
            "intent":"authorize",
            "REDIRECT":"https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-9P504127F4036564D"
        }
    ]
}
Default Response
The error response. The following are the internal error codes thrown by this API when the request processing fails in Oracle Commerce Cloud: |Error Code|Description| |------------------|------------------| |51173|Error while processing Payments.| |51174|Your order has not been placed due to a payment error, and you have not been charged. Please try again.| |51175|An error occurred completing an order payment.|
Body
Root Schema : errorModel
Type: object
Nested Schema : errors
Type: array
An optional list of errors if multiple errors were encountered
Nested Schema : items
Type: object

Examples

Sample Request:

{
  "orderId": "o80413",
  "profileId": "170309",
  "payments": [
    {
      "amount": "15.50",
      "customProperties": {
        "cust-prop2": "cust-prop2",
        "cust-prop1": "cust-prop1"
      },
      "giftCardNumber": "536564",
      "giftCardPin": "123",
      "billingAddress": {
        "lastName": "Anderson",
        "country": "US",
        "address2": "",
        "city": "Syracuse",
        "address1": "21 Cedar Ave",
        "postalCode": "13202",
        "county": "",
        "selectedCountry": "US",
        "firstName": "Kim",
        "phoneNumber": "212-555-1977",
        "state": "New York",
        "selectedState": "NY",
        "email": "kim@example.com (http://example.com/)",
        "state_ISOCode": "US-NY"
      },
      "paymentMethodType": "physicalGiftCard"
    },
    {
      "cardCVV": "333",
      "amount": "19.50",
      "customProperties": {
        "cust-prop2": "cust-prop2",
        "cust-prop1": "cust-prop1"
      },
      "nameOnCard": "Kim",
      "cardType": "visa",
      "expiryMonth": "3",
      "expiryYear": "2019",
      "billingAddress": {
        "lastName": "Anderson",
        "country": "US",
        "address2": "",
        "city": "Syracuse",
        "address1": "21 Cedar Ave",
        "postalCode": "13202",
        "county": "",
        "selectedCountry": "US",
        "firstName": "Kim",
        "phoneNumber": "212-555-1977",
        "state": "New York",
        "selectedState": "NY",
        "email": "kim@example.com (http://example.com/)",
        "state_ISOCode": "US-NY"
      },
      "paymentMethodType": "card",
      "cardNumber": "4111111111111111"
    }
  ]
}

Sample Response Payload returned by endpoint:

{
  "customPaymentProperties": {
    "sample-addnl-property-key2": "sample-payment-property-value2",
    "cust-prop2": "cust-prop2",
    "cust-prop1": "cust-prop1"
  },
  "orderId": "o50419",
  "profileId": "110093",
  "amountRemaining": 55,
  "links": [{
    "rel": "self",
    "href": "http://localhost:8080/ccstoreui/v1/payment"
  }],
  "paymentResponses": [{
    "paymentGroupId": "pg50414",
    "amount": 55,
    "gatewayName": "PP-A",
    "uiIntervention": "REDIRECT",
    "paymentMethod": "onlinePaymentGroup",
    "transaction_state": "created",
    "id": "PAY-48G29628SF768135MLCM36QI",
    "paymentState": "INITIAL",
    "type": "paypalCheckout",
    "intent": "authorize",
    "REDIRECT": "https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-9P504127F4036564D"
  }]
}