Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
Hi,
I have a POD dropshipping store. One of my supplier offers personalisation preview tool and they allow me to use the tool in my store. They provide API but are told they are not native to Shopify so it would require some tweaking.
They send an email " I have included below a python example to make personalisation image requests.
If you are able to convert the code into whatever development environment you are using, I will be able to set you up your own credentials."
import hashlib
import urllib.parse
def printgeneration():
username = 'SealAccount'
public_key = '3169D9B8'
secret_key = "B4F74C611688304783834DC103C97E0F86C2C18C9014734E"
pers_sku = 'P071176'
pers_line1 = 'Mr & Mrs Eaton'
pers_line2 = 'Lots of Love x'
stringtohash = """set{}tPers{{$Line1={};Line2={}$}}pw600co80u{}{}""".format(pers_sku, pers_line1, pers_line2, username, secret_key)
stringtohashplaceholder = """set{product_sku}tPers{{$Line1={personalisation}$}}pw600co80u{username}{secret_key}"""
print(stringtohash)
print('These are my Variables.....')
print(' ')
print('Username: {}'.format(username))
print('Product Sku : {}'.format(pers_sku))
print('Personalisation : Line 1 {} Line2 {}'.format(pers_line1, pers_line2))
print('')
print('Secret Key : {}'.format(secret_key))
print('Public Key : {}'.format(public_key))
print('')
print('This is my string to hash with placeholders.........')
print(stringtohashplaceholder)
print('')
print('This is my string to Hash')
print('{}'.format(stringtohash))
encypter = hashlib.md5(stringtohash.encode())
value = encypter.hexdigest()
print('This is my hashed string....'.format(value))
print('{}'.format(value))
print('')
print('This is the final url with the Seal you have created above added to the request string...')
pers_string = "{{$Line1={};Line2={}$}}".format(pers_line1, pers_line2)
pers_for_main_url = urllib.parse.quote_plus(pers_string)
#Pers{$ Line1 =Phillip$}
final_url = 'https://preview.personalised.com/dsmo/streamimage.aspx?set={}&t=Pers{}&pw=600&co=80&u={}&Seal={}'.format(pers_sku, pers_for_main_url, username, value)
print(final_url)
pass
if __name__ == '__main__':
printgeneration()
And they said creating a custom Shopify app would be the way to go. As I have basic knowledge in the field I'm not sure what I can do.
As for the products themselves I can import via the product csv they offer. Below is the screenshot of the supplier's website personlisation tool. Basically, all the product information, images, etc can be done by myself, and the tabs for input can also be done by an app. But once I click the preview button it generates a preview with the written text, that where the API, custom Shopify all come in and I have no clue whatsoever. If anyone can help, it would be appreciated.
Cheers,
Dee
Hi did you find a solution to this?