{"id":19622175,"url":"https://github.com/commercetools/sphere-order-export","last_synced_at":"2025-04-07T16:18:52.985Z","repository":{"id":11514231,"uuid":"13994866","full_name":"commercetools/sphere-order-export","owner":"commercetools","description":"Quick and easy way to export your orders from SPHERE.IO into files, with SFTP support!","archived":false,"fork":false,"pushed_at":"2024-11-17T12:12:39.000Z","size":681,"stargazers_count":4,"open_issues_count":33,"forks_count":68,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-04-02T23:56:50.903Z","etag":null,"topics":["audit-import-export"],"latest_commit_sha":null,"homepage":"https://impex.sphere.io","language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/commercetools.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-10-30T17:56:39.000Z","updated_at":"2024-11-17T12:12:43.000Z","dependencies_parsed_at":"2024-11-11T11:32:14.939Z","dependency_job_id":"1a78166a-ed87-49bc-936e-0f17288b81de","html_url":"https://github.com/commercetools/sphere-order-export","commit_stats":null,"previous_names":["sphereio/sphere-order-export"],"tags_count":62,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fsphere-order-export","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fsphere-order-export/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fsphere-order-export/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fsphere-order-export/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/commercetools","download_url":"https://codeload.github.com/commercetools/sphere-order-export/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247685628,"owners_count":20979085,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audit-import-export"],"created_at":"2024-11-11T11:26:27.330Z","updated_at":"2025-04-07T16:18:52.963Z","avatar_url":"https://github.com/commercetools.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv style=\"background-color: yellow; color: black; padding: 10px; text-align: center; font-weight: bold;\"\u003e\n  \u003ch2\u003e🚨 Non-maintainable 🚨\u003c/h2\u003e\n  \u003cp\u003eStarting January 1, 2025, we will no longer provide maintenance or updates for the CLI ImpEx tools. After this date, this tool will no longer receive bug fixes, security patches, or new features.\u003c/p\u003e\n\u003c/div\u003e\n\n\n\u003cimg src=\"https://impex.europe-west1.gcp.commercetools.com/static/images/ct-logo.svg\" alt=\"commercetools logo\" width=\"200\"\u003e\n# Order export\n\n[![NPM](https://nodei.co/npm/sphere-order-export.png?downloads=true)](https://www.npmjs.org/package/sphere-order-export)\n\n[![Build Status](https://secure.travis-ci.org/sphereio/sphere-order-export.png?branch=master)](http://travis-ci.org/sphereio/sphere-order-export) [![NPM version](https://badge.fury.io/js/sphere-order-export.png)](http://badge.fury.io/js/sphere-order-export) [![Coverage Status](https://coveralls.io/repos/sphereio/sphere-order-export/badge.png)](https://coveralls.io/r/sphereio/sphere-order-export) [![Dependency Status](https://david-dm.org/sphereio/sphere-order-export.png?theme=shields.io)](https://david-dm.org/sphereio/sphere-order-export) [![devDependency Status](https://david-dm.org/sphereio/sphere-order-export/dev-status.png?theme=shields.io)](https://david-dm.org/sphereio/sphere-order-export#info=devDependencies)\n\nThis module allows to export orders to XML or CSV, with SFTP support and order deliveries to CSV file.\n\n\u003e By default XML export will result in each file pro order\n\n## Getting started\n\n```bash\n$ npm install -g sphere-order-export\n\n# output help screen for order export\n$ order-export\n# output help screen for delivery export\n$ delivery-export\n```\n\n### SFTP\nExported orders (XML or CSV) can be automatically uploaded to an SFTP server.\n\nWhen using SFTP you need to provide at least the required `--sftp*` options:\n- `--sftpCredentials` (or `--sftpHost`, `--sftpUsername`, `--sftpPassword`)\n- `--sftpSource`\n- `--sftpTarget`\n\n**Note that only exported SFTP orders are marked as synced (`syncInfo`) with the channel key `OrderXmlFileExport`**\n\n### XML Format (default)\nOrders exported in XML will result in **each file pro order** like\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?\u003e\n\u003corder\u003e\n  \u003cxsdVersion\u003e0.9\u003c/xsdVersion\u003e\n  \u003cid\u003ea095493f-0750-41fe-9fa7-77cad095fe2a\u003c/id\u003e\n  \u003cversion\u003e1\u003c/version\u003e\n  \u003ccreatedAt\u003e2014-10-13T09:20:04.961Z\u003c/createdAt\u003e\n  \u003clastModifiedAt\u003e2014-10-13T09:20:04.961Z\u003c/lastModifiedAt\u003e\n  ...\n\u003c/order\u003e\n```\n\n### CSV Format\nOrders exported in CSV are stored in a single file\n\n\u003e At the moment you need to provide a `--csvTemplate` with headers in order to export related fields (see [examples](data)).\n\n```csv\nid,orderNumber,totalPrice,totalNet,totalGross\n```\n\nThe following headers can be used in the CSV template\n- `id`\n- `orderNumber`\n- `totalPrice` -\u003e results in a formated output of the price like `USD 9999`\n- `totalPrice.centAmount` -\u003e results in the pure number of `9999` (allows better sorting)\n- `totalNet`\n- `totalGross`\n- `customerGroup`\n- `customLineItems.*` - eg. `id`, `state`, `quantity` or `slug`\n- `lineItems.*` - eg. `id`, `state`, `quantity` or `supplyChannel`\n- `lineItems.variant.*` - eg. `sku`, `variantId`, `availability`, `prices` or `images`\n- `lineItems.variant.attributes.*` - eg. `lineItems.variant.attributes.color` will export attribute with name `color` \n- `custom.fields.*` - eg. `custom.fields.fieldName` will export custom field\n- `shippingAddress.*` - eg. `lastName` or `postalCode`\n- `billingAddress.*`\n- `custom.fields.*` - eg. `custom.fields.fieldName` will export custom field\n- `paymentInfo` - will export all associated payment IDs\n\nIn general you can get access to any property of the order object. Find a reference in our [API documentation](http://dev.sphere.io/http-api-projects-orders.html#order).\n\n\u003e Note that when at least one `lineItems` header is given the resulting CSV contains a row per lineItem. Otherwise it only contains one row per order.\n\nWhen exporting order with its line items, all redundant info (eg. general order information) is removed and printed only once in the first rows:\n```csv\nid,orderNumber,price,lineItems.id,lineItems.productId,billingAddress.firstName\n123,10001,USD 5950,,,John\n123,10001,,LineItemId-1-1,ProductId-1-1,\n123,10001,,LineItemId-1-2,ProductId-1-2,\n```\n\nIf needed you can specify a `--fillAllRows` parameter which will put general info also to line items rows:\n```csv\nid,orderNumber,price,lineItems.id,lineItems.productId,billingAddress.firstName\n123,10001,USD 5950,,,John\n123,10001,USD 5950,LineItemId-1-1,ProductId-1-1,John\n123,10001,USD 5950,LineItemId-1-2,ProductId-1-2,John\n```\n\nExample with custom fields:\n```csv\nid,orderNumber,custom.fields.stringField,custom.fields.booleanField\n1,10001,abcd,1\n2,10002,efgh,\n```\nBooleans with a `false` value are mapped as an empty string and `true` value is mapped as `1`.\n\nExample template for exporting lineItem attributes:\n```csv\nid,orderNumber,lineItems.variant.attributes.color,lineItems.variant.attributes.size_code,lineItems.variant.attributes.product_length,lineItems.variant.attributes.ean_codes,lineItems.variant.attributes.filter_colors,lineItems.variant.attributes.pinned,lineItems.variant.attributes.delivery_time\n```\n\n## Delivery export\nIt is possible to export order deliveries into CSV with the following command.\n```bash\n$ delivery-export --projectKey \u003cproject-key\u003e --targetDir exportedDeliveries\n```\nThis will create an `exportedDeliveries` folder with a `deliveries.csv` file where all deliveries are stored.\n\nExported CSV file has these fields:\n```csv\norderNumber,delivery.id,_itemGroupId,item.id,item.quantity,parcel.id,parcel.length,parcel.height,parcel.width,parcel.weight,parcel.trackingId,parcel.carrier,parcel.provider,parcel.providerTransaction,parcel.isReturn\n```\nAnd the structure is more described in the csv-parser-order package [here](https://commercetools.github.io/nodejs/cli/csv-parser-orders.html#deliveries).\n\n## Contributing\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).\nMore info [here](CONTRIBUTING.md).\n\n## Releasing\nReleasing a new version is completely automated using the Grunt task `grunt release`.\n\n```javascript\ngrunt release // patch release\ngrunt release:minor // minor release\ngrunt release:major // major release\n```\n\n## License\nCopyright (c) 2014 SPHERE.IO\nLicensed under the [MIT license](LICENSE-MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommercetools%2Fsphere-order-export","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommercetools%2Fsphere-order-export","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommercetools%2Fsphere-order-export/lists"}