addPayments
post
/ccstore/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:
string
operation - inquireBalance - to inquire balance of a GiftCard, initiate - for cash and paypalCehckout - orderId
-
Type:
string
Required:true
The order ID. - payments
-
Type:
array
paymentsRequired:true
Additional Properties Allowed:The array of Payments to be applied to the order.
Nested Schema : payments
Nested Schema : items
Type:
object
- amount
-
Type:
number
Required:true
Amount to be paid using this paymentMethod. - billingAddress
-
Type:
object
billingAddressAdditional Properties Allowed:The billing address details. - cardCVV
-
Type:
string
Credit/Debit card secret pin. PaymentMethodType: card. - cardNumber
-
Type:
string
Credit/Debit card number used for payment. PaymentMethodType: card. - cardType
-
Type:
string
Credit/Debit card type. e.g. visa. PaymentMethodType: card. - customProperties
-
Type:
object
customPropertiesAdditional Properties Allowed:Custom object with dynamic properties. This will be passed to the webhook request - expiryMonth
-
Type:
integer
Credit/Debit card expiry month. PaymentMethodType: card. - expiryYear
-
Type:
integer
Credit/Debit card expiry year. PaymentMethodType: card. - giftCardNumber
-
Type:
string
Gift card number used for payment. PaymentMethodType: physicalGiftCard. - giftCardPin
-
Type:
string
Gift card pin. PaymentMethodType: physicalGiftCard. - nameOnCard
-
Type:
string
Name on the credit/debit card. PaymentMethodType: card. - PayerID
-
Type:
string
Payer ID relevant to paypal checkout type. PaymentMethodType: paypalCheckout. - paymentGroupId
-
Type:
string
Payment Group ID relevant to the PaymentMethodType. PaymentMethodType: paypalCheckout, payUWebLatamCheckout. - paymentId
-
Type:
string
Payment ID relevant to the PaymentMethodType. PaymentMethodType: paypalCheckout - paymentMethodType
-
Type:
string
Required:true
Payment Method Type - payULatamWebcheckout,paypalCheckout,card,invoice,physicalGiftCard,cash - PONumber
-
Type:
string
Purchase order number for invoice payment. PaymentMethodType: invoice - token
-
Type:
string
Token relevant to paypal checkout type. PaymentMethodType: paypalCheckout.
Nested Schema : billingAddress
Type:
object
The billing address details.
- address1
-
Type:
string
Required:true
Address snippet. - address2
-
Type:
string
Address snippet. - address3
-
Type:
string
Address snippet. - alias
-
Type:
string
Address alias. - city
-
Type:
string
Required:true
City. - companyName
-
Type:
string
Company name. - country
-
Type:
string
Required:true
Country. - county
-
Type:
string
County. -
Type:
string
Email. - faxNumber
-
Type:
string
Fax number. - firstName
-
Type:
string
Required:true
First name. - jobTitle
-
Type:
string
Job title. - lastName
-
Type:
string
Required:true
Last name. - middleName
-
Type:
string
Middle name. - phoneNumber
-
Type:
string
Phone number. - postalCode
-
Type:
string
Required:true
Postal code. - prefix
-
Type:
string
Name prefix. - selectedCountry
-
Type:
string
Required:true
Country code. - selectedState
-
Type:
string
Required:true
State code. - state
-
Type:
string
Required:true
State. - state_ISOCode
-
Type:
string
Required:true
State ISO code. - suffix
-
Type:
string
Name suffix.
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
- amountRemaining
-
Type:
number
Amount Remaining - orderId
-
Type:
string
ORder Id - paymentResponses
-
Type:
array
paymentResponsesAdditional Properties Allowed:The array of payment responses - profileId
-
Type:
string
Profile ID of the shopper
Nested Schema : paymentResponses
Nested Schema : items
Type:
object
- accountId
-
Type:
string
Account ID for PayU based on Billing Country - amount
-
Type:
number
Amount authorized - balance
-
Type:
number
Balance for GiftCard - confirmationUrl
-
Type:
string
Confirmation URL - customPaymentProperties
-
Type:
object
customPaymentPropertiesAdditional Properties Allowed:Custom Payment Properties - gatewayName
-
Type:
string
Name of the Gateway used to process the payment - giftCardNumber
-
Type:
string
Gift Card Number - id
-
Type:
string
Id for Paypal - intent
-
Type:
string
Intent for Paypal - maskedCardNumber
-
Type:
string
Masked Gift Card Number - merchantId
-
Type:
string
Merchant ID for PayU - message
-
Type:
string
Error message, if any - paymentGroupId
-
Type:
string
Payment Group ID relevant to the PaymentMethodType - paymentId
-
Type:
string
Payment ID for PayU - paymentMethod
-
Type:
string
Payment Method Used - paymentState
-
Type:
string
Payment State of the payment - REDIRECT
-
Type:
string
Redirect URL for Paypal - responseUrl
-
Type:
string
Response URL - signature
-
Type:
string
Signature for PayU - signatureAlgorithm
-
Type:
string
Signature Algorithm used for PayU - sopUrl
-
Type:
string
URL to be redirected - transaction_state
-
Type:
string
Transaction State for Paypal - transactionStatusByQuery
-
Type:
string
Status of tranaction for PayU - type
-
Type:
string
PaymentMethodType - uiIntervention
-
Type:
string
If UI Intervention required
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
- devMessage
-
Type:
string
An optional non-localized message containing technical information for developers - errorCode
-
Type:
string
The numerical code identifying the error - errors
-
Type:
array
errorsAdditional Properties Allowed:An optional list of errors if multiple errors were encountered - message
-
Type:
string
The localized message describing the error - moreInfo
-
Type:
string
An optional non-localized message with more information - o:errorPath
-
Type:
string
An optional machine readable description of where the error occurred - status
-
Type:
string
The HTTP status code - type
-
Type:
string
The URI to the HTTP state code definition
Nested Schema : errors
Nested Schema : items
Type:
object
- devMessage
-
Type:
string
An optional non-localized message containing technical information for developers - errorCode
-
Type:
string
The numerical code identifying the error - message
-
Type:
string
The localized message describing the error - moreInfo
-
Type:
string
An optional non-localized message with more information - o:errorPath
-
Type:
string
An optional machine readable description of where the error occurred - status
-
Type:
string
The 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" }] }