Guides

Pre-Population API

Pre-Population API

Overview

The Pre-Population API has been designed for merchants who obtain and store their customers information within their own CMS. When a customer would like to purchase with humm, the Merchant can easily populate data from their CMS into a humm Buyer Portal application automatically using this API.

How does it work?

The client's browser performs a post to humm's API. The POST endpoint returns a view. This view is essentially a UI to complete the final payment step (and resolve any validation errors from the posted data).

An approved, declined, error page may follow an authorisation. These pages do not redirect automatically. The page relies on the client to press the Redirect Now button. This action will redirect to the URLs you provided in the original POST.


https://files.readme.io/7b5419423d8c0e08f6c1ef85036af5c85dbb1d3d6e7c8d1c31a39473e5bb2ad9-image.png

Resource Information

HTTP MethodPOST from a client side HTML page
Testing Resource URLhttps://integration-seller.shophumm.com.au/
Production Resource URLhttps://seller.shophumm.com.au/

Data Definitions

Request Parameters

Account Details

KeyTypeRequiredSampleDescription
x_account_idStringTrue30199999The merchant number provided to you by Humm.
x_signatureStringTrueThe signature for this request. See the section Signature Generation for details
x_guidGuid (200)FalseYour GUID reference for this transaction (required for resuming transactions)
x_referenceStringFalseABC123Your reference for this transaction
x_testBooleanFalseTruePerform process under test mode

Staff Information

KeyTypeRequiredSampleDescription
x_staff_first_nameStringFalseHarryThe first name of the staff member processing this transaction
x_staff_last_nameStringFalseTipperThe last name of the staff member processing this transaction

Transaction Details

KeyTypeRequiredSampleDescription
x_currencyStringFalseAUD, NZDWill default to AUD if not specified
x_amountDecimalFalse1500.00The total sales amount of the transaction
x_deposit_amountDecimalFalse100.00The deposit paid by the customer
productStringDiamond RingShort description of the item or service purchased. NOTE: This is excluded from the API signature process
x_vip_numberLong (10)False1234567890The customer's VIP or Pre-Approval number

Customer Personal Information

KeyTypeRequiredSampleDescription
x_customer_titleStringFalseMr = 1, Mrs = 2, Ms = 3, Miss = 4The customer's title
x_customer_first_nameStringFalseJohnThe customer's first name
x_customer_middle_nameStringFalseAndrewThe customer's middle name (not initial)
x_customer_last_nameStringFalseSmithThe customer's surname
x_customer_emailStringFalse[email protected]The customer's email address
x_customer_mobile_phoneStringFalse0400123123The customer's mobile phone number
x_customer_home_phoneStringFalse0881231234The customer's full home phone number
x_customer_dobDateFalse1980-12-01The customer's date of birth (ISO8601), 18 years and older

Customer Address

KeyTypeRequiredSampleDescription
x_customer_address_unitStringFalse1The customer's address (unit number)
x_customer_address_street_numberStringFalse97The customer's address (street number)
x_customer_address_street_nameStringFalsePirieThe customer's address (street name)
x_customer_address_street_typeStringFalseStreetThe customer's address (street type)
x_customer_suburbStringFalseAdelaideThe customer's address (suburb)
x_customer_stateStringFalseACT, NSW, QLD, SA, TAS, NT, VIC, WAThe customer's address (state)
x_customer_postcodeIntegerFalse5000The customer's address (postcode)
x_customer_countryStringFalseAU, NZWill default to AU if not specified

Employment Information

KeyTypeRequiredSampleDescription
x_customer_employment_statusIntegerFalseFullTime = 1, PartTime = 2, etc.Employment type of the customer
x_customer_employment_hours_per_weekDecimalFalse38Customer's total working hours (Not required for APC, VPC, SFR)
x_customer_employer_nameStringFalseBHP BillitonCustomer's employer (Not required for APC, VPC, SFR)
x_customer_employer_suburbStringFalseAdelaideCustomer's employer suburb
x_customer_work_phoneStringFalse0882345678Customer's work phone number
x_customer_abnStringFalse99 888 888 888Customer's ABN/ACN (Only if Self Employed)
x_customer_last_pay_dateDateFalse2018-05-01Customer's last pay date

Identification

KeyTypeRequiredSampleDescription
x_customer_id_typeIntegerFalse1: Driver's License, etc.Identity type provided by the customer
x_customer_id_stateStringFalseSAState where the Customer's Identity issued
x_customer_id_expiry_dateDateFalse2020-01-01Expiry date of Customer's Identity card
x_customer_id_numberStringFalseabc255qIdentity card number
x_customer_id_referenceStringFalse123Additional identity card number/reference

URLs

KeyTypeRequiredSampleDescription
x_url_cancelString (200)Falsehttps://example.com/CancelRedirect URL for cancellation/errors
x_url_completeString (200)Falsehttps://example.com/APICallback URL for API response

Response Parameters

KeyTypeDescription
x_account_idStringYour humm Merchant Number
x_purchase_numberStringYour purchase number for this transaction
x_referenceStringYour originating reference for this transaction
x_guidGuidYour originating GUID reference for this transaction
x_testBooleanTest mode enabled flag
x_amountDecimalThe purchase amount of the transaction
x_depositDecimalThe deposit amount required for this transaction
x_timestampDateTimeSystem timestamp for the transaction
x_resultStringResponse code (Pending, Approved, Cancelled, Declined, Errors, Expired)
x_signatureStringResponse signature for verification

Code Examples

HTML Generation

private function postToCheckout($checkoutUrl, $payload)

{

            echo

            "<html>

                        <body>

                        <form id='form' action='$checkoutUrl' method='post'>";

            foreach ($payload as $key => $value) {

                        echo "<input type='hidden' id='$key' name='$key' value='$value'/>";

            }

            echo

            '</form>

                        </body>';

            echo

            '<script>

                                    var form = document.getElementById("form");

                                    form.submit();

                        </script>

            </html>';

}

Signature Generation


Testing

The merchant API has a test page for constructing a valid POST message at https://uat-seller.shophumm.com.au/TEST/API. Make sure each request has a unique (GUID) API reference. You may want to use a form auto-filler such as Chrome recorder as this is a very large form.

Note: If you require Sandbox Credentials for testing the API, please reach out to us via the Integration Assistance Form.