POST Payment by context, contextId

Overview

Request

POST /[context]/[contextId]/Payment

Request Information

Request Parameters

Name
Type
Requirement
Description
context
String
Mandatory
Context in Request URI should be 'bookings' or 'customers'
contextId
Integer
Mandatory
ContextId in Request URI should be Booking ID or Customer ID
billingHouseNumberOrName
String
Optional
Billing House Number or Name. Mandatory for Adyen payments using 3DS2 only.
billingStreet
String
Optional
Billing Street. Mandatory for Adyen payments using 3DS2 only.
billingCity
String
Optional
Billing City. Mandatory for Adyen payments using 3DS2.
billingStateOrProvince
String
Optional
Billing State or Province. Mandatory for Adyen payments using 3DS2 and address is in the US or Canada only.
billingPostcode
String
Optional
Billing PostCode. Mandatory for Adyen payments using 3DS2 only.
billingCountryCode
String
Optional
Billing Country Code. Mandatory for Adyen payments using 3DS2.
returnURL
String
Optional
A valid http or https return url. Mandatory for Adyen payments using 3DS only.
originHost
String
Optional
Origin host. Mandatory for Adyen payments using 3DS only.
paymentMethodDetails
PaymentMethodDetails
Mandatory
paymentMethodDetails for Adyen payments.
browserInfo
BrowserInfo
Optional
browserInfo. Mandatory for Adyen payments using 3DS only.
shopperIP
String
Optional
shopperIP. Mandatory for Adyen payments using 3DS only.
paymentMethodId
Integer
Optional
Payment Method Id (Should be 32 for Adyen)
amount
Decimal
Mandatory
Amount (excluding donation amount)
donationAmount
Decimal
Optional
Donation Amount
currencyCode
String
Mandatory
CurrencyCode

Paymentmethoddetails

Name
Type
Requirement
Description
uniquePaymentMethodCode
String
Mandatory
uniquePaymentMethodCode. As specified in the GET PaymentMethods response.
encryptedCardNumber
String
Mandatory
encryptedCardNumber
encryptedExpiryMonth
String
Mandatory
encryptedExpiryMonth
encryptedExpiryYear
String
Mandatory
encryptedExpiryYear
encryptedSecurityCode
String
Mandatory
encryptedSecurityCode
cardHolderName
String
Mandatory
cardHolderName

Browserinfo

Name
Type
Requirement
Description
acceptHeader
String
Mandatory
The accept header value of the shopper's browser.
language
String
Mandatory
The navigator.language value of the shopper's browser (as defined in IETF BCP 47).
colorDepth
Integer
Mandatory
The color depth of the shopper's browser in bits per pixel. This should be obtained by using the browser's screen.colorDepth property. Accepted values: 1, 4, 8, 15, 16, 24, 32 or 48 bit color depth.
javaEnabled
Boolean
Mandatory
Boolean value indicating if the shopper's browser is able to execute Java.
javaScriptEnabled
Boolean
Optional
Boolean value indicating if the shopper's browser is able to execute JavaScript. A default 'true' value is assumed if the field is not present.
screenHeight
Integer
Mandatory
The total height of the shopper's device screen in pixels.
screenWidth
Integer
Mandatory
The total width of the shopper's device screen in pixels.
timeZoneOffset
Integer
Mandatory
Time difference between UTC time and the shopper's browser local time, in minutes.
userAgent
String
Mandatory
The user agent value of the shopper's browser.

Request Example

{
  "billingHouseNumberOrName": "12",
  "billingStreet": "Templeton St",
  "billingCity": "Melbourne",
  "billingStateOrProvince": "CA",
  "billingPostcode": "3000",
  "billingCountryCode": "AU",
  "returnURL": "http://127.0.0.1/",
  "originHost": "https://bookings.intrepidtravel.com",
  "paymentMethodDetails": {
    "uniquePaymentMethodCode": "scheme",
    "encryptedCardNumber": "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
    "encryptedExpiryMonth": "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
    "encryptedExpiryYear": "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
    "encryptedSecurityCode": "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
    "cardHolderName": "Bart Simpson"
  },
  "browserInfo": {
    "acceptHeader": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
    "language": "en-EN",
    "colorDepth": 24,
    "javaEnabled": false,
    "javaScriptEnabled": true,
    "screenHeight": 768,
    "screenWidth": 1080,
    "timeZoneOffset": 660,
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0"
  },
  "shopperIP": "8.8.8.8",
  "paymentMethodId": 32,
  "amount": 2500.0,
  "donationAmount": 25.0,
  "currencyCode": "USD"
}

Response Information

Response Properties

Name
Type
Description
paymentReference
String
PaymentReference
isSuccessfulPayment
Boolean
Is Successful Payment
amountPaid
Decimal
Amount Paid
currencyCode
String
Currency code
transactionDate
String
Transaction date
errorCode
String
Error Code
message
String
Message
paymentId
String
Payment Id
paymentProcessAuditId
String
Payment Process Audit Id
actionRequired
String
Action Required. Sent if payment is Adyen. "Redirect" if redirect is required, "None" if not.
redirectRequest
RedirectRequest
Redirect Request. The object that is sent if "actionRequired" is "Redirect". Should be passed to the Adyen component as per their documentation.
bookingId
Integer
Txn Id

Redirectrequest

Name
Type
Description
data
IEnumerable`1
Redirect Request data

Response Codes

HTTP status code
Description
200 OK
The resource was updated successfully
201 Created
The resource was created
400 Bad Request
The resource was malformed
401 Unauthorized
Missing or invalid API key
500 Internal Server Error
An unexpected error occurred on the API server
202 Accepted
The request was accepted
404 Not Found
The specified resource was not found
403 Forbidden
One or more parameters has already been set on the resource record and cannot be updated

Response Example

{
  "paymentReference": "4357886618",
  "isSuccessfulPayment": true,
  "amountPaid": 2500.0,
  "currencyCode": "USD",
  "transactionDate": "2019-01-29 21:50:15",
  "errorCode": "22053",
  "message": "Transaction accepted",
  "paymentId": "1379227",
  "paymentProcessAuditId": "369100",
  "actionRequired": "Redirect",
  "redirectRequest": {
    "data": "[{ \"key\": \"MD\", \"value\": \"Ab02b4c0!BQABAgCW5sxB4e/==..\"}, { \"key\": \"PaReq\", \"value\": \"eNrNV0mTo7gS..\" }]"
  },
  "bookingId": "6174439"
}