> For the complete documentation index, see [llms.txt](https://help.openloyalty.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.openloyalty.io/api-reference/import/import-file.md).

# Import file

Management\ <br>

````json
{"openapi":"3.0.0","info":{"title":"Open Loyalty","version":"0.0.1"},"tags":[{"name":"Import","description":"These endpoints will allow you to import data."}],"servers":[{"url":"http://openloyalty.localhost"}],"security":[{"Bearer":[]},{"token":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Open Loyalty has the JWT authorization.\nTo learn what a JSON Web Token is and how it works, check out Introduction to JSON Web Tokens <https://jwt.io/introduction/>\n\n### Obtain an access token\n\nSend a request with the parameters username and password\n\n#### Definition\n\n`POST /api/admin/login_check` [Go to definition](#operation/adminLoginCheck)\\\n`POST /api/{storeCode}/member/login_check` [Go to definition](#operation/memberLoginCheck)\n\n#### Example\n\n```bash\ncurl {HOST}/api/admin/login_check\n    -H 'Content-Type: application/json;charset=UTF-8'\n    -H 'Accept: application/json, text/plain, */*'\n    --data-binary '{\"username\":\"admin\",\"password\":\"password\"}'\n```\n\n#### Example Response\n\n```json\n{\n    \"token\":\"eyJhbGciOiJSUzI1NiIsInR5cCI6...\",\n    \"refresh_token\":\"0558f8bb29948c4e54c443f...\"\n}\n```\n\n### Using JSON Web Token\n\nAdd authorization header to each request\\\n`Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...`\\\nYou can now access any API method you want under the /api prefix.\n\n#### Example\n```bash\ncurl {HOST}/api/{storeCode}/analytics/members\n    -H 'Accept: application/json'\n    -H 'Content-type: application/x-www-form-urlencoded'\n    -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...'\n```\n\n### Refresh JSON Web Token\nYou can refresh token using refresh_token that was given during login.\\\nThere are two endpoints\\\nTo refresh admin token `POST /api/token/refresh` [Go to definition](#operation/tokenRefresh)\\\nTo refresh member token `POST /api/{storeCode}/token/refresh` [Go to definition](#operation/tokenRefreshMember)\n","bearerFormat":"JWT","scheme":"bearer"},"token":{"type":"apiKey","name":"X-AUTH-TOKEN","in":"header"}},"parameters":{"storeCode":{"name":"storeCode","in":"path","description":"Store code","required":true,"schema":{"type":"string"}}},"responses":{"BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"required":["code","message","errors"],"properties":{"code":{"type":"integer"},"message":{"type":"string"},"errors":{"type":"array","items":{"required":["message","parameters","plural","code","path"],"properties":{"message":{"type":"string"},"parameters":{},"plural":{"type":"integer","nullable":true},"code":{"type":"string"},"path":{"type":"string"}},"type":"object"}}},"type":"object"}}}},"AccessDenied":{"description":"Forbidden.","content":{"application/json":{"schema":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}}},"NotFound":{"description":"Not found.","content":{"application/json":{"schema":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}}}},"schemas":{"ExpiredToken":{"required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}},"type":"object"},"InvalidToken":{"required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}},"type":"object"},"Unauthorized":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}},"paths":{"/api/{storeCode}/import/{type}":{"post":{"tags":["Import"],"summary":"Import file","description":"<label style=\"background-color: #D4EDBC;padding:5px;\">Management</label><br><br>\n","operationId":"postImport","parameters":[{"$ref":"#/components/parameters/storeCode"},{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["member","groupValue","segmentMembers","memberCustomAttributes","unitTransferAdding","unitTransferSpending","transaction","campaignCode","rewardCoupon","memberCustomField","issuedRewardStatusChange","productCatalogProducts"]}}],"requestBody":{"description":"","content":{"multipart/form-data":{"schema":{"oneOf":[{"title":"Import Members","properties":{"import":{"required":["file"],"properties":{"file":{"description":"See <a href=\"https://help.openloyalty.io/main-features/imports-exports/imports/sample-import-files\" target=\"_blank\">sample import files available in the import guide</a>\n","type":"object"}},"type":"object"}},"type":"object"},{"title":"Import Group values","properties":{"import":{"required":["additionalData","file"],"properties":{"additionalData":{"required":["groupOfValuesId"],"properties":{"groupOfValuesId":{"type":"string"}},"type":"object"},"file":{"description":"See <a href=\"https://help.openloyalty.io/main-features/imports-exports/imports/sample-import-files\" target=\"_blank\">sample import files available in the import guide</a>\n","type":"object"}},"type":"object"}},"type":"object"},{"title":"Import Campaign codes","properties":{"import":{"required":["additionalData","file"],"properties":{"additionalData":{"required":["campaignId"],"properties":{"campaignId":{"type":"string"}},"type":"object"},"file":{"description":"See <a href=\"https://help.openloyalty.io/main-features/imports-exports/imports/sample-import-files\" target=\"_blank\">sample import files available in the import guide</a>\n","type":"object"}},"type":"object"}},"type":"object"},{"title":"Import Reward Coupons","properties":{"import":{"required":["additionalData","file"],"properties":{"additionalData":{"required":["rewardId"],"properties":{"rewardId":{"type":"string","format":"uuid"}},"type":"object"},"file":{"description":"CSV file with reward coupons. Required columns: `rewardId` (UUID, must match `additionalData.rewardId`) and `coupon` (string, max 315 chars).\nSee <a href=\"https://help.openloyalty.io/main-features/imports-exports/imports/sample-import-files\" target=\"_blank\">sample import files available in the import guide</a>\n","type":"string","format":"binary"}},"type":"object"}},"type":"object"},{"title":"Import Segment Members","properties":{"import":{"required":["additionalData","file"],"properties":{"additionalData":{"required":["segmentId","identificationMethod"],"properties":{"segmentId":{"type":"string","format":"uuid"},"identificationMethod":{"description":"The identification method allows you to map an identifier to the appropriate member.\nTherefore, you should choose an identification method that corresponds to the type of member identifiers included in the file.\nSee <a href=\"https://help.openloyalty.io/main-features/imports-exports/imports/sample-import-files\" target=\"_blank\">sample import files available in the import guide</a>\n","type":"string","enum":["uuid","email","phone","loyaltyCardNumber"]}},"type":"object"},"file":{"description":"A file with a list of member identifiers.\nAll identifiers in the imported file must be of the same type.\nAvailable identifier types are: uuid, email, phone, loyaltyCardNumber.\nSee <a href=\"https://help.openloyalty.io/main-features/imports-exports/imports/sample-import-files\" target=\"_blank\">sample import files available in the import guide</a>\n","type":"string","format":"binary"}},"type":"object"}},"type":"object"},{"title":"Import Member Custom Attributes","properties":{"import":{"required":["additionalData","file"],"properties":{"additionalData":{"required":["identificationMethod"],"properties":{"identificationMethod":{"description":"The identification method allows you to map a member identifier in the file to the appropriate member.\nTherefore, you should choose an identification method that corresponds to the type of member identifiers included in the file.\nSee <a href=\"https://help.openloyalty.io/main-features/imports-exports/imports/sample-import-files\" target=\"_blank\">sample import files available in the import guide</a>\n","type":"string","enum":["uuid","email","phone","loyaltyCardNumber"]}},"type":"object"},"file":{"description":"A wide-format CSV file. The first column is the reserved `memberId` header holding the member identifier (its type must match `additionalData.identificationMethod`); every other column header is a custom attribute key and its cell the value to upsert. An empty cell removes that attribute from the member.\nSee <a href=\"https://help.openloyalty.io/main-features/imports-exports/imports/sample-import-files\" target=\"_blank\">sample import files available in the import guide</a>\n","type":"string","format":"binary"}},"type":"object"}},"type":"object"},{"title":"Import adding units transfers","properties":{"import":{"required":["file"],"properties":{"file":{"description":"See <a href=\"https://help.openloyalty.io/main-features/imports-exports/imports/sample-import-files\" target=\"_blank\">sample import files available in the import guide</a>\n","type":"string","format":"binary"}},"type":"object"}},"type":"object"},{"title":"Import spending units transfers","properties":{"import":{"required":["file"],"properties":{"file":{"description":"See <a href=\"https://help.openloyalty.io/main-features/imports-exports/imports/sample-import-files\" target=\"_blank\">sample import files available in the import guide</a>\n","type":"string","format":"binary"}},"type":"object"}},"type":"object"},{"title":"Import transactions","properties":{"import":{"required":["file"],"properties":{"file":{"description":"See <a href=\"https://help.openloyalty.io/main-features/imports-exports/imports/sample-import-files\" target=\"_blank\">sample import files available in the import guide</a>\n","type":"string","format":"binary"}},"type":"object"}},"type":"object"},{"title":"Import Member Custom Fields","properties":{"import":{"required":["additionalData","file"],"properties":{"additionalData":{"required":["identificationMethod"],"properties":{"identificationMethod":{"description":"How to match the member — one type for the whole file. Choose the type that corresponds to the member identifiers used in the file.\n","type":"string","enum":["uuid","email","phone","loyaltyCardNumber"]}},"type":"object"},"file":{"description":"JSON file. An array of rows; each row has an `identifier` (matching the chosen `identificationMethod`) and a `customFields` object in the `{ group: { field: value } }` shape used by member edit (PATCH). A field sent as `null` clears it.\nSee <a href=\"https://help.openloyalty.io/main-features/imports-exports/imports/sample-import-files\" target=\"_blank\">sample import files available in the import guide</a>\n","type":"string","format":"binary"}},"type":"object"}},"type":"object"},{"title":"Import issued reward status changes","properties":{"import":{"required":["file"],"properties":{"file":{"description":"UTF-8 CSV file (no BOM) with the header `issuedRewardId,status,comment`. One row per status change: `issuedRewardId` is the UUID of an existing issued reward in the store, `status` is one of the allowed issued reward statuses (lowercase) and `comment` is optional free text of at most 255 characters.\n","type":"string","format":"binary"}},"type":"object"}},"type":"object"},{"title":"Import Product Catalog Products","properties":{"import":{"required":["additionalData","file"],"properties":{"additionalData":{"required":["productCatalogId"],"properties":{"productCatalogId":{"type":"string","format":"uuid"}},"type":"object","additionalProperties":false},"file":{"description":"See <a href=\"https://help.openloyalty.io/main-features/imports-exports/imports/sample-import-files\" target=\"_blank\">sample import files available in the import guide</a>\n","type":"string","format":"binary"}},"type":"object","additionalProperties":false}},"type":"object"}]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"required":["importId"],"properties":{"importId":{"type":"string","format":"uuid"}},"type":"object"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ExpiredToken"},{"$ref":"#/components/schemas/InvalidToken"},{"$ref":"#/components/schemas/Unauthorized"}]}}}},"403":{"$ref":"#/components/responses/AccessDenied"},"404":{"$ref":"#/components/responses/NotFound"}}}}}}
````


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.openloyalty.io/api-reference/import/import-file.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
