addPayments
post
/ccagent/v1/payment
Add Payments. Add payments to an order.
Request
Supported Media Types
- application/json
Body Parameter
Root Schema : addPayments_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"
}
]
}
- op
-
Type:
stringoperation - inquireBalance - to inquire balance of a GiftCard, initiate - for cash and paypalCehckout - orderId
-
Type:
stringRequired:trueThe order ID. - payments
-
Type:
arraypaymentsRequired:trueAdditional Properties Allowed:The array of Payments to be applied to the order.
Nested Schema : payments
Nested Schema : items
Type:
object- amount
-
Type:
numberRequired:trueAmount to be paid using this paymentMethod. - billingAddress
-
Type:
objectbillingAddressAdditional Properties Allowed:The billing address details. - cardCVV
-
Type:
stringCredit/Debit card secret pin. PaymentMethodType: card. - cardNumber
-
Type:
stringCredit/Debit card number used for payment. PaymentMethodType: card. - cardType
-
Type:
stringCredit/Debit card type. e.g. visa. PaymentMethodType: card. - customProperties
-
Type:
objectcustomPropertiesAdditional Properties Allowed:Custom object with dynamic properties. This will be passed to the webhook request - expiryMonth
-
Type:
integerCredit/Debit card expiry month. PaymentMethodType: card. - expiryYear
-
Type:
integerCredit/Debit card expiry year. PaymentMethodType: card. - giftCardNumber
-
Type:
stringGift card number used for payment. PaymentMethodType: physicalGiftCard. - giftCardPin
-
Type:
stringGift card pin. PaymentMethodType: physicalGiftCard. - nameOnCard
-
Type:
stringName on the credit/debit card. PaymentMethodType: card. - PayerID
-
Type:
stringPayer ID relevant to paypal checkout type. PaymentMethodType: paypalCheckout. - paymentGroupId
-
Type:
stringPayment Group ID relevant to the PaymentMethodType. PaymentMethodType: paypalCheckout, payUWebLatamCheckout. - paymentId
-
Type:
stringPayment ID relevant to the PaymentMethodType. PaymentMethodType: paypalCheckout - paymentMethodType
-
Type:
stringRequired:truePayment Method Type - payULatamWebcheckout,paypalCheckout,card,invoice,physicalGiftCard,cash - PONumber
-
Type:
stringPurchase order number for invoice payment. PaymentMethodType: invoice - token
-
Type:
stringToken relevant to paypal checkout type. PaymentMethodType: paypalCheckout.
Nested Schema : billingAddress
Type:
objectThe billing address details.
- address1
-
Type:
stringRequired:trueAddress snippet. - address2
-
Type:
stringAddress snippet. - address3
-
Type:
stringAddress snippet. - alias
-
Type:
stringAddress alias. - city
-
Type:
stringRequired:trueCity. - companyName
-
Type:
stringCompany name. - country
-
Type:
stringRequired:trueCountry. - county
-
Type:
stringCounty. -
Type:
stringEmail. - faxNumber
-
Type:
stringFax number. - firstName
-
Type:
stringRequired:trueFirst name. - jobTitle
-
Type:
stringJob title. - lastName
-
Type:
stringRequired:trueLast name. - middleName
-
Type:
stringMiddle name. - phoneNumber
-
Type:
stringPhone number. - postalCode
-
Type:
stringRequired:truePostal code. - prefix
-
Type:
stringName prefix. - selectedCountry
-
Type:
stringRequired:trueCountry code. - selectedState
-
Type:
stringRequired:trueState code. - state
-
Type:
stringRequired:trueState. - state_ISOCode
-
Type:
stringRequired:trueState ISO code. - suffix
-
Type:
stringName suffix.
Nested Schema : customProperties
Type:
objectCustom 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
- amountRemaining
-
Type:
numberAmount Remaining - orderId
-
Type:
stringORder Id - paymentResponses
-
Type:
arraypaymentResponsesAdditional Properties Allowed:The array of payment responses - profileId
-
Type:
stringProfile ID of the shopper
Nested Schema : paymentResponses
Nested Schema : items
Type:
object- accountId
-
Type:
stringAccount ID for PayU based on Billing Country - amount
-
Type:
numberAmount authorized - balance
-
Type:
numberBalance for GiftCard - confirmationUrl
-
Type:
stringConfirmation URL - customPaymentProperties
-
Type:
objectcustomPaymentPropertiesAdditional Properties Allowed:Custom Payment Properties - gatewayName
-
Type:
stringName of the Gateway used to process the payment - giftCardNumber
-
Type:
stringGift Card Number - id
-
Type:
stringId for Paypal - intent
-
Type:
stringIntent for Paypal - maskedCardNumber
-
Type:
stringMasked Gift Card Number - merchantId
-
Type:
stringMerchant ID for PayU - message
-
Type:
stringError message, if any - paymentGroupId
-
Type:
stringPayment Group ID relevant to the PaymentMethodType - paymentId
-
Type:
stringPayment ID for PayU - paymentMethod
-
Type:
stringPayment Method Used - paymentState
-
Type:
stringPayment State of the payment - REDIRECT
-
Type:
stringRedirect URL for Paypal - responseUrl
-
Type:
stringResponse URL - signature
-
Type:
stringSignature for PayU - signatureAlgorithm
-
Type:
stringSignature Algorithm used for PayU - sopUrl
-
Type:
stringURL to be redirected - transaction_state
-
Type:
stringTransaction State for Paypal - transactionStatusByQuery
-
Type:
stringStatus of tranaction for PayU - type
-
Type:
stringPaymentMethodType - uiIntervention
-
Type:
stringIf UI Intervention required
Nested Schema : customPaymentProperties
Type:
objectCustom 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- devMessage
-
Type:
stringAn optional non-localized message containing technical information for developers - errorCode
-
Type:
stringThe numerical code identifying the error - errors
-
Type:
arrayerrorsAdditional Properties Allowed:An optional list of errors if multiple errors were encountered - message
-
Type:
stringThe localized message describing the error - moreInfo
-
Type:
stringAn optional non-localized message with more information - o:errorPath
-
Type:
stringAn optional machine readable description of where the error occurred - status
-
Type:
stringThe HTTP status code - type
-
Type:
stringThe URI to the HTTP state code definition
Nested Schema : errors
Nested Schema : items
Type:
object- devMessage
-
Type:
stringAn optional non-localized message containing technical information for developers - errorCode
-
Type:
stringThe numerical code identifying the error - message
-
Type:
stringThe localized message describing the error - moreInfo
-
Type:
stringAn optional non-localized message with more information - o:errorPath
-
Type:
stringAn optional machine readable description of where the error occurred - status
-
Type:
stringThe HTTP status code
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"
}]
}