|
2294 | 2294 | "Suppliers" |
2295 | 2295 | ], |
2296 | 2296 | "summary": "List suppliers", |
2297 | | - "description": "The *List suppliers* endpoint returns a list of [suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection.\n\n[Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service.\n\nBy default, this endpoint returns a list of active and archived suppliers. You can use [querying](https://docs.codat.io/using-the-api/querying) to change that. \n\nFor example, to retrieve only active suppliers (i.e. `status=Active`) or suppliers created within the specified number of days (e.g. `sourceModifiedDate>2023-12-15T00:00:00.000Z`), query the endpoint as follows: `/payables/suppliers?query=sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active`.For example, to retrieve active suppliers modified after a particular date use `query=sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active`.", |
| 2297 | + "description": "The *List suppliers* endpoint returns a list of [suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection.\n\n[Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service.\n\nBy default, this endpoint returns a list of active and archived suppliers. You can use [querying](https://docs.codat.io/using-the-api/querying) to change that. \n\nFor example, to retrieve only active suppliers (i.e. `status=Active`) or suppliers created within the specified number of days (e.g. `sourceModifiedDate>2023-12-15T00:00:00.000Z`), query the endpoint as follows: `/payables/suppliers?query=sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active`.For example, to retrieve active suppliers modified after a particular date use `query=sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active`.\n\n### Supported Integrations\n\n| Integration | Supported |\n|-------------------------------|-----------|\n| FreeAgent | Yes |\n| QuickBooks Online | Yes |\n| Xero | Yes |\n| Oracle NetSuite | Yes |\n| Sage Intacct | Yes |\n| Zoho Books | Yes |", |
2298 | 2298 | "operationId": "list-suppliers", |
2299 | 2299 | "parameters": [ |
2300 | 2300 | { |
|
2353 | 2353 | "city": "Bakersfield", |
2354 | 2354 | "region": "California", |
2355 | 2355 | "country": "USA", |
2356 | | - "postalcode": "93308" |
| 2356 | + "postalCode": "93308" |
2357 | 2357 | } |
2358 | 2358 | ], |
2359 | 2359 | "status": "Active", |
|
2421 | 2421 | "Suppliers" |
2422 | 2422 | ], |
2423 | 2423 | "summary": "Create supplier", |
2424 | | - "description": "The *Create supplier* endpoint creates a new [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection.\r\n\r\n[Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service.\r\n", |
| 2424 | + "description": "The *Create supplier* endpoint creates a new [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection.\r\n\r\n[Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service.\r\n\r\n### Supported Integrations\r\n\r\n| Integration | Supported |\r\n|-------------------------------|-----------|\r\n| FreeAgent | Yes |\r\n| QuickBooks Online | Yes |\r\n| Xero | Yes |\r\n| Oracle NetSuite | Yes |\r\n| Sage Intacct | Yes |\r\n| Zoho Books | Yes |\r\n", |
2425 | 2425 | "operationId": "create-supplier", |
2426 | 2426 | "parameters": [ |
2427 | 2427 | { |
|
2442 | 2442 | "examples": { |
2443 | 2443 | "Suppliers": { |
2444 | 2444 | "value": { |
2445 | | - "supplierName": "Greggs", |
2446 | | - "contactName": "Greg Greggs", |
2447 | | - "emailAddress": "greg@greggs.com", |
| 2445 | + "supplierName": "Northridge Office Supplies", |
| 2446 | + "contactName": "Sarah Johnson", |
| 2447 | + "emailAddress": "sarah.johnson@northridgesupplies.co.uk", |
2448 | 2448 | "phone": "+44 (0)1223 322410", |
2449 | 2449 | "addresses": [ |
2450 | 2450 | { |
|
2453 | 2453 | "line2": "2 Dennis Avenue", |
2454 | 2454 | "city": "London", |
2455 | 2455 | "region": "Camden", |
2456 | | - "country": "GBR", |
| 2456 | + "country": "GB", |
2457 | 2457 | "postalCode": "EC1N 7TE" |
2458 | 2458 | } |
2459 | 2459 | ], |
|
2477 | 2477 | "Suppliers": { |
2478 | 2478 | "value": { |
2479 | 2479 | "id": "sup-10933920", |
2480 | | - "supplierName": "Greggs", |
2481 | | - "contactName": "Greg Greggs", |
2482 | | - "emailAddress": "greg@greggs.com", |
| 2480 | + "supplierName": "Northridge Office Supplies", |
| 2481 | + "contactName": "Sarah Johnson", |
| 2482 | + "emailAddress": "sarah.johnson@northridgesupplies.co.uk", |
2483 | 2483 | "phone": "+44 (0)1223 322410", |
2484 | | - "address": [ |
| 2484 | + "addresses": [ |
2485 | 2485 | { |
2486 | 2486 | "type": "Billing", |
2487 | 2487 | "line1": "Flat 1", |
2488 | 2488 | "line2": "2 Dennis Avenue", |
2489 | 2489 | "city": "London", |
2490 | 2490 | "region": "Camden", |
2491 | | - "country": "GBR", |
| 2491 | + "country": "GB", |
2492 | 2492 | "postalCode": "EC1N 7TE" |
2493 | 2493 | } |
2494 | 2494 | ], |
2495 | 2495 | "status": "Active", |
2496 | | - "defaultCurrency": "GBP" |
| 2496 | + "balance": 0, |
| 2497 | + "defaultCurrency": "GBP", |
| 2498 | + "sourceModifiedDate": "2026-03-18T10:30:00Z" |
| 2499 | + } |
| 2500 | + } |
| 2501 | + } |
| 2502 | + } |
| 2503 | + } |
| 2504 | + }, |
| 2505 | + "400": { |
| 2506 | + "$ref": "#/components/responses/BadRequest" |
| 2507 | + }, |
| 2508 | + "401": { |
| 2509 | + "$ref": "#/components/responses/Unauthorized" |
| 2510 | + }, |
| 2511 | + "402": { |
| 2512 | + "$ref": "#/components/responses/Payment-Required" |
| 2513 | + }, |
| 2514 | + "403": { |
| 2515 | + "$ref": "#/components/responses/Forbidden" |
| 2516 | + }, |
| 2517 | + "404": { |
| 2518 | + "$ref": "#/components/responses/Not-Found" |
| 2519 | + }, |
| 2520 | + "429": { |
| 2521 | + "$ref": "#/components/responses/Too-Many-Requests" |
| 2522 | + }, |
| 2523 | + "500": { |
| 2524 | + "$ref": "#/components/responses/Internal-Server-Error" |
| 2525 | + }, |
| 2526 | + "503": { |
| 2527 | + "$ref": "#/components/responses/Service-Unavailable" |
| 2528 | + } |
| 2529 | + } |
| 2530 | + } |
| 2531 | + }, |
| 2532 | + "/companies/{companyId}/connections/{connectionId}/payables/suppliers/{supplierId}": { |
| 2533 | + "parameters": [ |
| 2534 | + { |
| 2535 | + "$ref": "#/components/parameters/companyId" |
| 2536 | + }, |
| 2537 | + { |
| 2538 | + "$ref": "#/components/parameters/connectionId" |
| 2539 | + }, |
| 2540 | + { |
| 2541 | + "name": "supplierId", |
| 2542 | + "in": "path", |
| 2543 | + "required": true, |
| 2544 | + "schema": { |
| 2545 | + "type": "string", |
| 2546 | + "examples": [ |
| 2547 | + "13d946f0-c5d5-42bc-b092-97ece17923ab", |
| 2548 | + "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2", |
| 2549 | + 7110701885, |
| 2550 | + "EILBDVJVNUAGVKRQ" |
| 2551 | + ] |
| 2552 | + }, |
| 2553 | + "description": "Unique identifier for a supplier." |
| 2554 | + } |
| 2555 | + ], |
| 2556 | + "put": { |
| 2557 | + "tags": [ |
| 2558 | + "Suppliers" |
| 2559 | + ], |
| 2560 | + "summary": "Update supplier", |
| 2561 | + "description": "The *Update supplier* endpoint updates an existing [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection.\n\n[Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service.\n\nThis is a full-replace PUT endpoint. Any fields not included in the request body will be cleared on the supplier record.\n\n### Supported Integrations\n\n| Integration | Supported |\n|-------------------------------|-----------|\n| FreeAgent | Yes |\n| QuickBooks Online | Yes |\n| Xero | Yes |\n| Oracle NetSuite | No |\n| Sage Intacct | No |\n| Zoho Books | No |\n\n### Platform-specific behavior\n\n- **Xero**: Archived suppliers cannot be updated (returns `400`). Suppliers must be unarchived manually in the Xero UI before updating.\n- **QuickBooks Online**: Currency can only be set when creating a supplier, and cannot be changed via update.\n", |
| 2562 | + "operationId": "update-supplier", |
| 2563 | + "requestBody": { |
| 2564 | + "content": { |
| 2565 | + "application/json": { |
| 2566 | + "schema": { |
| 2567 | + "$ref": "#/components/schemas/Supplier/definitions/supplierPrototype" |
| 2568 | + }, |
| 2569 | + "examples": { |
| 2570 | + "Update supplier": { |
| 2571 | + "value": { |
| 2572 | + "supplierName": "Northridge Office Supplies", |
| 2573 | + "contactName": "Sarah Johnson", |
| 2574 | + "emailAddress": "sarah.johnson@northridgesupplies.co.uk", |
| 2575 | + "phone": "+44 (0)1223 322410", |
| 2576 | + "addresses": [ |
| 2577 | + { |
| 2578 | + "type": "Billing", |
| 2579 | + "line1": "Flat 1", |
| 2580 | + "line2": "2 Dennis Avenue", |
| 2581 | + "city": "London", |
| 2582 | + "region": "Camden", |
| 2583 | + "country": "GB", |
| 2584 | + "postalCode": "EC1N 7TE" |
| 2585 | + } |
| 2586 | + ], |
| 2587 | + "status": "Active", |
| 2588 | + "defaultCurrency": "GBP" |
| 2589 | + } |
| 2590 | + } |
| 2591 | + } |
| 2592 | + } |
| 2593 | + } |
| 2594 | + }, |
| 2595 | + "responses": { |
| 2596 | + "200": { |
| 2597 | + "description": "Success", |
| 2598 | + "content": { |
| 2599 | + "application/json": { |
| 2600 | + "schema": { |
| 2601 | + "$ref": "#/components/schemas/Supplier" |
| 2602 | + }, |
| 2603 | + "examples": { |
| 2604 | + "Updated supplier": { |
| 2605 | + "value": { |
| 2606 | + "id": "sup-10933920", |
| 2607 | + "supplierName": "Northridge Office Supplies", |
| 2608 | + "contactName": "Sarah Johnson", |
| 2609 | + "emailAddress": "sarah.johnson@northridgesupplies.co.uk", |
| 2610 | + "phone": "+44 (0)1223 322410", |
| 2611 | + "addresses": [ |
| 2612 | + { |
| 2613 | + "type": "Billing", |
| 2614 | + "line1": "Flat 1", |
| 2615 | + "line2": "2 Dennis Avenue", |
| 2616 | + "city": "London", |
| 2617 | + "region": "Camden", |
| 2618 | + "country": "GB", |
| 2619 | + "postalCode": "EC1N 7TE" |
| 2620 | + } |
| 2621 | + ], |
| 2622 | + "status": "Active", |
| 2623 | + "balance": 0, |
| 2624 | + "defaultCurrency": "GBP", |
| 2625 | + "sourceModifiedDate": "2026-03-18T10:30:00Z" |
2497 | 2626 | } |
2498 | 2627 | } |
2499 | 2628 | } |
|
2560 | 2689 | "examples": { |
2561 | 2690 | "Bank account example": { |
2562 | 2691 | "value": { |
2563 | | - "id": "fb623ab2-f6ff-4b22-b7d3-b7cc2a4aa0ea", |
2564 | 2692 | "nominalCode": "22", |
2565 | 2693 | "name": "Plutus - Payables - Bank Account 12", |
2566 | 2694 | "accountNumber": "0120 0440", |
2567 | 2695 | "sortCode": "50-50-50", |
2568 | 2696 | "currency": "GBP", |
2569 | | - "accountType": "Debit", |
2570 | | - "status": "Active", |
2571 | | - "sourceModifiedDate": "2024-02-22T14:46:43.99Z" |
| 2697 | + "accountType": "Debit" |
2572 | 2698 | } |
2573 | 2699 | } |
2574 | 2700 | } |
|
2583 | 2709 | "schema": { |
2584 | 2710 | "$ref": "#/components/schemas/BankAccount" |
2585 | 2711 | }, |
2586 | | - "examples": {} |
| 2712 | + "examples": { |
| 2713 | + "Created bank account": { |
| 2714 | + "value": { |
| 2715 | + "id": "fb623ab2-f6ff-4b22-b7d3-b7cc2a4aa0ea", |
| 2716 | + "nominalCode": "22", |
| 2717 | + "name": "Plutus - Payables - Bank Account 12", |
| 2718 | + "accountNumber": "0120 0440", |
| 2719 | + "sortCode": "50-50-50", |
| 2720 | + "currency": "GBP", |
| 2721 | + "accountType": "Debit", |
| 2722 | + "status": "Active", |
| 2723 | + "sourceModifiedDate": "2024-02-22T14:46:43.99Z" |
| 2724 | + } |
| 2725 | + } |
| 2726 | + } |
2587 | 2727 | } |
2588 | 2728 | } |
2589 | 2729 | }, |
|
2718 | 2858 | "country": { |
2719 | 2859 | "type": "string", |
2720 | 2860 | "nullable": true, |
2721 | | - "description": "Country of the customer's address. For NetSuite, use the 2-digit [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) country code." |
| 2861 | + "description": "Country of the address. We recommend using the 2-digit ISO 3166 country code (e.g. `GB`, `US`, `FR`) as this is accepted by all supported platforms." |
2722 | 2862 | }, |
2723 | 2863 | "postalCode": { |
2724 | 2864 | "type": "string", |
|
4745 | 4885 | }, |
4746 | 4886 | "examples": [ |
4747 | 4887 | { |
4748 | | - "id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F", |
4749 | | - "supplierName": "Kelly's Industrial Supplies", |
4750 | | - "contactName": "Kelly Ipsum", |
4751 | | - "emailAddress": "sales@kellysupplies.com", |
4752 | | - "phone": "07999 999999", |
| 4888 | + "id": "sup-10933920", |
| 4889 | + "supplierName": "Northridge Office Supplies", |
| 4890 | + "contactName": "Sarah Johnson", |
| 4891 | + "emailAddress": "sarah.johnson@northridgesupplies.co.uk", |
| 4892 | + "phone": "+44 (0)1223 322410", |
4753 | 4893 | "addresses": [ |
4754 | 4894 | { |
4755 | 4895 | "type": "Billing", |
4756 | | - "line1": "Unit 51", |
4757 | | - "line2": "Bakersfield Industrial Estate", |
4758 | | - "city": "Bakersfield", |
4759 | | - "region": "California", |
4760 | | - "country": "USA", |
4761 | | - "postalcode": "93308" |
| 4896 | + "line1": "Flat 1", |
| 4897 | + "line2": "2 Dennis Avenue", |
| 4898 | + "city": "London", |
| 4899 | + "region": "Camden", |
| 4900 | + "country": "GB", |
| 4901 | + "postalCode": "EC1N 7TE" |
4762 | 4902 | } |
4763 | 4903 | ], |
4764 | 4904 | "status": "Active", |
4765 | | - "amount": 100, |
| 4905 | + "balance": 0, |
4766 | 4906 | "defaultCurrency": "GBP", |
4767 | | - "sourceModifiedDate": "2022-10-23T00:00:00Z" |
| 4907 | + "sourceModifiedDate": "2026-03-18T10:30:00Z" |
4768 | 4908 | } |
4769 | 4909 | ] |
4770 | 4910 | } |
|
0 commit comments