RHP_API

<back to all web services

CreateUserPurchase

Purchase via CC

Requires Authentication
The following routes are available for this service:
POST/User/Purchase
CreateUserPurchase Parameters:
NameParameterData TypeRequiredDescription
PurchaseTokenbodystringNoPurchase token
CardbodyCreditCardNoCredit card details
ProductbodySelectedProductNoSelected product
UseStoredCardbodyboolNoUserStoredCard if set to true the stored card will be used to process the transaction. This field is not required.
UseDiamondsbodyboolNoUseDiamonds if set to true Diamonds will be used to process the transaction. This field is not required.
TokenbodyPaymentTokenNoToken from Apple or Google pay. This field is not required.
CreditCard Parameters:
NameParameterData TypeRequiredDescription
NumberformstringNoCredit card number
MonthformintNo2 digit number representing the month
YearformintNo2 digit number representing the year
CCVformstringNo3 digit security code
SelectedProduct Parameters:
NameParameterData TypeRequiredDescription
TokenformstringNoProduct token, represents the selected product and duration
PaymentToken Parameters:
NameParameterData TypeRequiredDescription
TypeformPaymentTokenTypeNo
TokenformstringNo
PurchaseResponse Parameters:
NameParameterData TypeRequiredDescription
PaymentSuccessformboolNoIndicates if a transaction has succeded
PaymentResponseformPaymentResultNoProvides additional detail to the payments status
ErrorCodeformstringNoIf payment failed additional error code is returned
ErrorMessageformstringNoIf payment failed additional error message is returned
ReceiptformPurchaseReceiptNoIf payment has succeded the receipt details are returned
PurchaseReceipt Parameters:
NameParameterData TypeRequiredDescription
AmountformReceiptAmountNoPayment amount
CompanyformstringNoCompany name, that is displayed on the user's bank statement
ABNformstringNoAustralian Business Number
ReceiptNumberformstringNoReceipt number for the payment
CreditCardNumberformstringNoMasked Credit Card number
ReceiptAmount Parameters:
NameParameterData TypeRequiredDescription
TotalformdecimalNoTotal amount of payment
TaxformdecimalNoTax included in the payment
AmountLessTaxformdecimalNoTotal minus Tax

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /User/Purchase HTTP/1.1 
Host: tstsrvs.redhotpie.com.au 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"PurchaseToken":"String","Card":{"Number":"String","Month":0,"Year":0,"CCV":"String"},"Product":{"Token":"String"},"UseStoredCard":false,"UseDiamonds":false,"Token":{"Type":"ApplePay","Token":"String"}}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"PaymentSuccess":false,"PaymentResponse":"TokenAcquisitionFailed","ErrorCode":"String","ErrorMessage":"String","Receipt":{"Amount":{"Total":0,"Tax":0,"AmountLessTax":0},"Company":"String","ABN":"String","ReceiptNumber":"String","CreditCardNumber":"String"}}