Authorization (SSO)
Data Flow
To provide better customer experience Shopboxo does not use guest order/checkout, hence it must create a customer in merchant backend if customer does not exist already.
note
Super app customer data is shared to Miniapp, not the other way around.
API reference
- Shopify
- Magento
Search customer API
shopify.Customer.search(email=email)
Create customer API
shopify.Customer.create(customer_data)
Search customer API
curl --location -g --request GET '{{DOMAIN}}/rest/V1/customers/search?search_criteria[filter_groups][0][filters][0][field]=email&search_criteria[filter_groups][0][filters][0][value]={{customer_email}}&search_criteria[filter_groups][0][filters][0][condition_type]=eq' \
--header 'Authorization: Bearer {{ACCESS_TOKEN}}'
Create customer API
curl --location --request POST '{{DOMAIN}}/rest/V1/customers' \
--header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"customer": {
"email": "{{email}}",
"firstname": "{{first_name}}",
"lastname": "{{last_name}}",
"custom_attributes": [
{
"attribute_code": "mobile_number",
"value": "{{phone}}"
}
]
}
}'