Customer and Payment Updates

View as Markdown

Customer Contact Details Update

When a customer changes their email address associated with their account, Ordergroove needs to be notified of this change. This notification is sent via a PATCH request to the set contact details endpoint.

Destination

Staging: https://staging.restapi.ordergroove.com/customers/{merchant_user_id}/set_contact_details
Production: https://restapi.ordergroove.com/customers/{merchant_user_id}/set_contact_details

headers = {
'authorization': '{"public_id": "<MERCHANT_PUBLIC_ID>", "ts": <SECONDS_SINCE_EPOCH>, "sig_field": "<MERCHANT_USER_ID>", "sig": "<SIGNATURE>"}',
'content-type': 'application/json'
}

Customer Contact Details Responses

Success Response

If a successful connection is made, the request will always result in a secure HTTP response object with code 200 and a JSON payload

1{
2"phone_number": "<Phone_Number>",
3"email": "<Email>"
4}

Error Responses

In the event of an error with the request, one of the following error codes may be returned with the corresponding JSON payload

1 {
2 "[field_name]": "field_name error detail"
3 }

Customer Payment Update

When a customer changes their default payment for subscriptions within their account wallet, Ordergroove needs to be notified of this change. This notification is sent via a POST request to the update payment default endpoint.

Destination:

Staging: https://staging.v2.ordergroove.com/customer/update_payment_default
Production: https://api.ordergroove.com/customer/update_payment_default

URL Encode Individual Fields

Each field needs to be URL encoded (special characters such as & will otherwise break the update request), not just the encrypted fields. The entire post should not be URL encoded, just the fields individually.

Request
1update_request={
2 "merchant_id": "<MERCHANT_ID>",
3 "user": {
4 "user_id": "<MERCHANT_USER_ID>",
5 "ts": "<TIME_STAMP>", // timestamp is seconds since epoch
6 "sig": "<SIGNATURE>" // Hmac signature based on user id and timestamp | Url encoded
7 },
8 "payment": {
9 "label": "<LABEL>", // optional
10 "card_type": "<ENUMERATED_CARD_TYPE>", // 1 = Visa, 2 = MasterCard, 3= American Express, 4 = Discover
11 "cc_exp_date": "<MM/YYYY_AES_ENCRYPTED>", //should be url encoded after being encrypted | Value should always be 12/2099 for PayPal
12 "cc_last_4": "<CC_LAST_4_DIGITS_AES_ENCRYPTED>", //should be url encoded after being encrypted
13 "cc_holder": "<CC_HOLDER_AES_ENCRYPTED>", //should be url encoded after being encrypted
14 "token_id":"<TOKEN_ID>" // optional,
15 "billing": { // optional
16 "first_name": "<FIRST_NAME>",
17 "last_name": "<LAST_NAME>",
18 "phone": "<PHONE>",
19 "address": "<ADDRESS>",
20 "address2": "<ADDRESS2>",
21 "city": "<CITY>",
22 "country_code": "<COUNTRY_CODE>",
23 "zip_postal_code": "<ZIP>",
24 "fax": "<FAX>",
25 "state_province_code": "<STATE_PROVINCE_CODE>",
26 "company_name": "<COMPANY_NAME>"
27 }
28 }
29}

Customer Payment Update Responses

Success Response

If all validations pass, and the customer payment is updated successfully, this API will simply respond with “SUCCESS”.

Error messages

The following is the list of possible messages when an “error” result is provided in the response. In case of an error message, no updates to the customer are performed.

  • “Invalid Merchant”
  • “Invalid Request”
    • An invalid JSON object is the most likely cause of this error
  • “Customer does not exist”
  • “Could not decode cc_exp_date”
  • “<merchant_name> is not configured to accept <payment_field>”