Create

You can create your first helloPay transaction by following the process below.

1. Get shopConfig

Log in to your helloPay merchant account and navigate to the Account Settings page. There you will find your unique shopConfig.

For testing purposes you can use the shopConfig provided below.

2. Create Transaction

You can create a purchase by POSTing data to the /merchant/create endpoint. Your request should have all required data formatted as JSON in the body. The request must contain this header: Content-Type: application/json.

Example request


curl -H "Content-Type: application/json" \  
     -u rocket:rock4mebuddy \
     -d "data={ \
              "priceAmount": "8999000.00", \
              "priceCurrency": "SGD", \
              "description": "This is the ideal purchase", \
              "merchantReferenceId": "104565007",  // this number should be unique \
              "purchaseSuccessUrl": "https:\/\/www.supermagicshop.co.id\/checkout\/finish\/hellopaysuccess", \
              "purchaseFailureUrl": "https:\/\/www.supermagicshop.co.id\/checkout\/finish\/hellopaycancel", \
              "basket": { \
                         "basketItems": [ \
                                        { \
                                        "name": "Canyonero", \
                                        "quantity": 1, \
                                        "amount": "8999000.00", \
                                        "imageUrl": "http:\/\/imgur.com\/gallery\/aVJtllp", \
                                        "currency": "SGD" \
                                        } \
                                        ], \
                         "shipping": "0.00", \
                         "totalAmount": "8999000.00", \
                         "currency": "SGD" \
               }, \
               "shippingAddress": { \
               "name": "Homer Simpson", \
               "addressLine1": "Jalan Jend. Sudirman No.Kav 10-11", \
               "city": "Singapore", \
               "country": "SG", \
               "mobilePhoneNumber": "+655557334" \
               }, \
               "billingAddress": { \
                                "name": "Homer Simpson", \
                                "addressLine1": "123 Central", \
                                "city": "Singapore", \
                                "country": "SG", \
                                "mobilePhoneNumber": "+655557334" \
               }, \
               "consumerData": { \
                               "mobilePhoneNumber": "+655557334", \
                               "emailAddress": "chunkylover53@aol.com", \
                               "country": "SG \
                               "language": "en", \
                               "ipAddress": "127.0.0.1", \
                               "name": "Homer Simpson" \
               }, \
               "additionalData": {}, \
               "shopConfig": "AAEAAADoKU7YJh44utJbVDLTqqEEeiaO28_f9LjaYMu1GdoBNT9_IG--\/AAEAAAgfi0NkDIDyXMhIaaM-wfYLziibzdgBQIQVoD4hzxDnQt5szEIq\/0ce5b60001d7e89c7b50fbe59cfb1bf5" \
               }"  \
     https://sandbox.hellopay.com.sg/merchant/create

Successful response example

{
  "success":true,
  "checkoutUrl":"https:\/\/sandbox.hellopay.com.sg\/checkout\/?purchaseId=AAEAAADoKU7SPetIl5sQm3TX3UYQr2itSspQUO2yzCzCIYoUm9-MzfU0",
  "purchaseId":"AAEAAADoKU7SPetIl5sQm3TX3UYQr2itSspQUO2yzCzCIYoUm9-MzfU0"
}

Error response example

{
  "success": false,
  "message": "There were errors in JSON data sent!"
}

Full Documentation

In order to enhance your customer's checkout experience and security as well as to provide access to all supported payment methods, we recommend that you send us all customer and purchase related information. You will find all the fields that we support and their purpose in the table below.

RequiredParamDescription
*priceAmountTotal order amount
*priceCurrencyISO 4217 currency code
*descriptionA description of your transaction, such as "Purchase on MyShop.com"
merchantReferenceIdYour unique order Id. You will be able to search for your orders using your Id in your merchant account area.
purchaseSuccessUrlThis is where the customer will be redirected after successfully completing the checkout, i.e. your success page.
purchaseFailureUrlThis is where the customer will be redirected in case an error occurs during the checkout. We'd recommend that this URL should take the customer back to the screen where he can select an alternative payment method.
purchaseCallbackUrlWe can notify you about status changes concerning your purchases by calling your purchaseCallbackUrl. It should point to your service that can accept payloads from us in an urleconded JSON format. You can find more details below.
basketAn object containing information about what the customer has ordered.
> basketItemsAn object containing information about each item in your order.
>> nameItem name
>> quantityItem quantity
>> amountItem price
>> taxAmountTax for the item
>> imageUrlURL pointing to the product image
>> currencyISO 4217 currency code
> shippingShipping cost
> totalTaxAmountTax for the whole order
> totalAmountTotal value of all items in cart
> currencyISO 4217 currency code
shippingAddressAn object containing the shipping address of the customer.
> nameConcatenated customer name: Firstname Lastname
> firstName If you have the name separated please also send the first name directly.
> lastName If you have the name separated please also send the last name directly.
> addressLine1Contains things like street name and house number.
> provinceProvince, e.g. "DKI Jakarta"
> citycity, e.g. "Kota Jakarta Utara"
> countryCounty
> mobilePhoneNumberCustomer's mobile phone number
> houseNumberHouse number
> addressLine2Address line 2
> districtDistrict, e.g. "Penjaringan"
> zipZip code
*billingAddressAn object containing the shipping address of the customer. It is required to submit the customer's billing address in order to allow credit card transactions.
*> nameConcatenated customer full name: Firstname Lastname
> firstName If you have the name separated please also send the first name directly.
> lastName If you have the name separated please also send the last name directly.
*> addressLine1Contains things like street name and house number.
*> provinceProvince, e.g. "DKI Jakarta"
*> citycity, e.g. "Kota Jakarta Utara"
*> countryCountry
*> mobilePhoneNumberCustomer's mobile phone number
> houseNumberHouse number
> addressLine2Address line 2
*> districtDistrict, e.g. "Penjaringan"
> zipZip code
*consumerDataAn object containing data about the customer.
*> mobilePhoneNumberCustomer's contact mobile phone number.
*> emailAddressCustomer's contact email address.
> countryCustomer's ISO norm country code
> languageCustomer's contact email address.
> dateOfBirthCustomer's date of birth in format DD/MM/YYYY
> genderCustomer's gender
> ipAddressCustomer's IP address. Used to increase security.
> nameConcatenated customer full name: Firstname Lastname
> firstNameCustomer's first name
> lastNameCustomer's last name
additionalDataAn object that contains additional data.
> deliveryNoteHere you can add as many keys and values as you want to help you track
> deliveryTimeExpected delivery time
> deliveryTimeStringdeliveryTime formatted as string.
> deviceTypeYou can use this to track the device of the user.
*shopConfigYour unique shopConfig, which is being used to authenticate you.

Next Up:

Cancel a purchase