You'll likely recognize most of the fields you see below, for more information you can find an explanation of each here.
Caution: Some aspects of this article may require technical expertise with coding languages.
If you do not currently have someone on staff or contract that can provide that level of technical assistance, Ordergroove suggests seeking out that level of support before attempting to add or alter any working code relating to your subscriptions or storefront.
Q: What kind of file is this?
It is a newline delimited JSON file where each customer's data is its own JSON object on its own line.
Q: Why use a newline delimited JSON file?
It's the difference between reading a book on a single long page or breaking it up into 1000 pages. With a newline delimited JSON file it is much faster to process one customer at a time.
Q: Is it one line per customer or subscription?
One line per customer. Addresses and payments and subscriptions are connected using their IDs in the origin object.
Q: Can I upload a 'prettified' version of the JSON file?
No, the file must be minimized — you can use this tool to go back and forth.
Example: Single Customer JSON Object
You need to create the below object for each customer and put each object on a new line in a file:
{
"customer": {
"merchant" : "n83hg5fm7d82345f727dk203",
"merchant_user_id": "2398573030",
"first_name": "Sam",
"last_name": "Smith",
"email": "sam.smith@ordergroove.com",
"live": true,
"phone_number": null,
"extra_data": null,
"price_code": null,
"created": "2021-02-26 18:15:07",
"origin": {
"id": 3452345784
}
},
"addresses": [
{
"customer": "2398573030",
"address_type": "billing_address",
"first_name": "Sam",
"last_name": "Smith",
"address": "1 Fifth Ave",
"city": "New York",
"state_province_code": "NY",
"zip_postal_code": "10003",
"country_code": "US",
"live": true,
"phone": "555-123-4567",
"origin": {
"id": 3452277044
}
},
{
"customer": "2398573030",
"address_type": "shipping_address",
"first_name": "Sam",
"last_name": "Smith",
"address": "1 Fifth Ave",
"city": "New York",
"state_province_code": "NY",
"zip_postal_code": "10003",
"country_code": "US",
"live": true,
"phone": "555-123-4567",
"origin": {
"id": 61377044
}
}
],
"payments": [
{
"customer": "2398573030",
"live": true,
"token_id": "274573947",
"cc_holder": "Sam Smith",
"cc_type": 2,
"cc_exp_date": "09/2022",
"created": "2021-02-26 18:15:07",
"origin": {
"id": 567563456,
"billing_address": 3452277044
}
}
],
"subscriptions": [
{
"customer": "2398573030",
"product": "3g2375g385",
"offer": "b6b8cf7c52346234652342b6aba89ec1ea9",
"merchant_order_id": "18076256",
"live": true,
"every": 4,
"every_period": "week",
"quantity": 1,
"price": "18.99",
"start_date": "2020-07-21",
"cancelled": null,
"next_order_date": "2021-03-21",
"components": null,
"origin": {
"id": 56723446,
"payment": 567563456,
"shipping_address": 61377044
}
},
{
"customer": "2398573030",
"product": "09832ng9739",
"offer": "b6b8cf7c52346234652342b6aba89ec1ea9",
"merchant_order_id": "18076256",
"live": false,
"every": 3,
"every_period": "month",
"quantity": 1,
"price": "48.99",
"start_date": "2020-07-21",
"cancelled": "2020-09-21 10:21:56",
"next_order_date": null,
"components": [
"323453434",
"j45235432",
"867g30481"
],
"origin": {
"id": 2435764567,
"payment": 567563456,
"shipping_address": 61377044
}
}
]
}
Comments
Article is closed for comments.