{"__v":3,"_id":"571f4229cb4baa0e00d139e7","api":{"auth":"required","params":[],"results":{"codes":[]},"settings":"","url":""},"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Get Import\"\n}\n[/block]\nEndpoint: `https://api.clubcollect.com/api/v2/imports/{import_id}`\n\nHTTP method: `GET`\n\nThis method can be used to obtain all data known by ClubCollect about an import. An API partner usually calls this method in response to a notification sent by ClubCollect about an update to an import.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\t\\\"import_id\\\": \\\"...\\\",\\n    \\\"title\\\": \\\"...\\\",\\n    \\\"transmitted\\\": true|false,\\n    \\\"transmitted_at\\\": \\\"...\\\",\\n    \\\"prepaid_amount_cents\\\": 123,\\n    \\\"prepaid_amount_currency\\\": \\\"EUR|GBP\\\",\\n    \\\"settled_amount_cents\\\": 456,\\n    \\\"settled_amount_currency\\\": \\\"EUR|GBP\\\",\\n  \\t\\\"invoice_ids\\\": [..., ...]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nRequired fields:\n\n* `import_id`\n\nError response (status: 404):\n\n* `{\"error\":\"invalid_import_id\"}` : No import with this ID could be found.\n\nNotes:\n\n* Date format: ISO 8601\n\nThe `invoice_ids` array can be used by the API consumer to verify whether the invoices it assumes have been submitted to ClubCollect have actually been created on ClubCollect's side.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Create Import\"\n}\n[/block]\nEndpoint: `https://api.clubcollect.com/api/v2/imports`\n\nHTTP method: `POST`\n\nCall this method to create a new, empty import. \n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"An import must be created before you create any invoices.\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"company_id\\\": \\\"...\\\",\\n  \\\"title\\\": \\\"Test\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nRequired fields:\n\n* `company_id`: this value is supplied to you by ClubCollect\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"If you leave the `title` empty the company name will be used to name the import.\"\n}\n[/block]\nSuccessful response: same as for **Get Import** endpoint (see above)\n\nError response (status: 422):\n\n* `{\"error\":\"invalid_company_id\"}` : No company with this ID could be found.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Transmit Import\"\n}\n[/block]\nEndpoint: `https://api.clubcollect.com/api/v2/imports/{import_id}/transmit`\n\nHTTP method: `PUT`\n\nCall this method to instruct ClubCollect to start processing the import starting by sending messages.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"Ensure sure you have finished creating all invoices for this import before calling this method.\"\n}\n[/block]\nRequired fields:\n\n* `import_id`\n\nSuccessful response will be an empty response with an 200 status code.\n\nError responses:\n\n  * `invalid_import_id` : No import with this ID could be found.\n  * `import_already_transmitted` : Import with this ID has already been transmitted.\n  * `import_contains_no_invoices`: Import with this ID doesn't contain invoices.\n\nExample (status: 404/422):\n\n* `{\"errors\":\"invalid_import_id\"}` : No company with this ID could be found.","category":"571f4229cb4baa0e00d139e4","createdAt":"2015-02-10T14:21:30.941Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"54d902e26a09052100a6b623","slug":"imports","sync_unique":"","title":"/imports","type":"basic","updates":[],"user":"54d902d56a09052100a6b622","version":"571f4229cb4baa0e00d139e3","childrenPages":[]}
[block:api-header] { "type": "basic", "title": "Get Import" } [/block] Endpoint: `https://api.clubcollect.com/api/v2/imports/{import_id}` HTTP method: `GET` This method can be used to obtain all data known by ClubCollect about an import. An API partner usually calls this method in response to a notification sent by ClubCollect about an update to an import. [block:code] { "codes": [ { "code": "{\n \t\"import_id\": \"...\",\n \"title\": \"...\",\n \"transmitted\": true|false,\n \"transmitted_at\": \"...\",\n \"prepaid_amount_cents\": 123,\n \"prepaid_amount_currency\": \"EUR|GBP\",\n \"settled_amount_cents\": 456,\n \"settled_amount_currency\": \"EUR|GBP\",\n \t\"invoice_ids\": [..., ...]\n}", "language": "json" } ] } [/block] Required fields: * `import_id` Error response (status: 404): * `{"error":"invalid_import_id"}` : No import with this ID could be found. Notes: * Date format: ISO 8601 The `invoice_ids` array can be used by the API consumer to verify whether the invoices it assumes have been submitted to ClubCollect have actually been created on ClubCollect's side. [block:api-header] { "type": "basic", "title": "Create Import" } [/block] Endpoint: `https://api.clubcollect.com/api/v2/imports` HTTP method: `POST` Call this method to create a new, empty import. [block:callout] { "type": "info", "body": "An import must be created before you create any invoices." } [/block] [block:code] { "codes": [ { "code": "{\n \"company_id\": \"...\",\n \"title\": \"Test\"\n}", "language": "json" } ] } [/block] Required fields: * `company_id`: this value is supplied to you by ClubCollect [block:callout] { "type": "info", "body": "If you leave the `title` empty the company name will be used to name the import." } [/block] Successful response: same as for **Get Import** endpoint (see above) Error response (status: 422): * `{"error":"invalid_company_id"}` : No company with this ID could be found. [block:api-header] { "type": "basic", "title": "Transmit Import" } [/block] Endpoint: `https://api.clubcollect.com/api/v2/imports/{import_id}/transmit` HTTP method: `PUT` Call this method to instruct ClubCollect to start processing the import starting by sending messages. [block:callout] { "type": "info", "body": "Ensure sure you have finished creating all invoices for this import before calling this method." } [/block] Required fields: * `import_id` Successful response will be an empty response with an 200 status code. Error responses: * `invalid_import_id` : No import with this ID could be found. * `import_already_transmitted` : Import with this ID has already been transmitted. * `import_contains_no_invoices`: Import with this ID doesn't contain invoices. Example (status: 404/422): * `{"errors":"invalid_import_id"}` : No company with this ID could be found.