Skip to content

Commit 5569c8d

Browse files
authored
Merge pull request #159 from XeroAPI/sid-development
Updates for Accounting and Projects
2 parents 1a74572 + 0937696 commit 5569c8d

File tree

6 files changed

+239
-4
lines changed

6 files changed

+239
-4
lines changed

accounting-yaml/Xero_accounting_swagger.yaml renamed to accounting-yaml/xero_accounting.yaml

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11074,6 +11074,157 @@ contact: {}, date:"2020-01-01", user:{} } ] } ] }'
1107411074
schema:
1107511075
$ref: '#/components/schemas/PurchaseOrders'
1107611076
example: '{ purchaseOrders:[ { attentionTo:"Peter Parker",lineItems: [],contact: {} } ] }'
11077+
'/PurchaseOrders/{PurchaseOrderNumber}':
11078+
parameters:
11079+
- $ref: '#/components/parameters/requiredHeader'
11080+
x-related-model: PurchaseOrder
11081+
get:
11082+
security:
11083+
- OAuth2: [accounting.transactions.read]
11084+
tags:
11085+
- Accounting
11086+
operationId: getPurchaseOrderByNumber
11087+
summary: Allows you to retrieve a specified purchase orders
11088+
parameters:
11089+
- required: true
11090+
in: path
11091+
name: PurchaseOrderNumber
11092+
description: Unique identifier for a PurchaseOrder
11093+
example: "PO1234"
11094+
schema:
11095+
type: string
11096+
responses:
11097+
'200':
11098+
description: Success - return response of type PurchaseOrder array for specified PurchaseOrder
11099+
content:
11100+
application/json:
11101+
schema:
11102+
$ref: '#/components/schemas/PurchaseOrders'
11103+
example: '{
11104+
"Id": "53a8c7a5-92e8-475b-a037-acf7c55c3afd",
11105+
"Status": "OK",
11106+
"ProviderName": "Java Partner Example",
11107+
"DateTimeUTC": "\/Date(1553626110950)\/",
11108+
"PurchaseOrders": [
11109+
{
11110+
"PurchaseOrderID": "15369a9f-17b6-4235-83c4-0029256d1c37",
11111+
"PurchaseOrderNumber": "PO-0006",
11112+
"DateString": "2019-03-26T00:00:00",
11113+
"Date": "\/Date(1553558400000+0000)\/",
11114+
"DeliveryDateString": "2019-03-28T00:00:00",
11115+
"DeliveryDate": "\/Date(1553731200000+0000)\/",
11116+
"DeliveryAddress": "101 Grafton Road\nRoseneath\nWellington\n6011\nNew Zealand",
11117+
"AttentionTo": "CEO",
11118+
"Telephone": "64 123-2222",
11119+
"DeliveryInstructions": "Drop off at front door",
11120+
"HasErrors": false,
11121+
"IsDiscounted": true,
11122+
"TotalDiscount": 250.00,
11123+
"SentToContact": false,
11124+
"Reference": "foobar",
11125+
"Type": "PURCHASEORDER",
11126+
"CurrencyRate": 1.000000,
11127+
"CurrencyCode": "NZD",
11128+
"Contact": {
11129+
"ContactID": "430fa14a-f945-44d3-9f97-5df5e28441b8",
11130+
"ContactStatus": "ACTIVE",
11131+
"Name": "Liam Gallagher",
11132+
"FirstName": "Liam",
11133+
"LastName": "Gallagher",
11134+
"EmailAddress": "[email protected]",
11135+
"BankAccountDetails": "",
11136+
"Addresses": [
11137+
null,
11138+
{
11139+
"AddressType": "POBOX",
11140+
"City": "Anytown",
11141+
"Region": "NY",
11142+
"PostalCode": "10101",
11143+
"Country": "USA",
11144+
"AttentionTo": ""
11145+
}
11146+
],
11147+
"Phones": [
11148+
{
11149+
"PhoneType": "DEFAULT",
11150+
"PhoneNumber": "222-2222",
11151+
"PhoneAreaCode": "212",
11152+
"PhoneCountryCode": ""
11153+
},
11154+
null,
11155+
{
11156+
"PhoneType": "FAX",
11157+
"PhoneNumber": "333-2233",
11158+
"PhoneAreaCode": "212",
11159+
"PhoneCountryCode": ""
11160+
},
11161+
{
11162+
"PhoneType": "MOBILE",
11163+
"PhoneNumber": "444-3433",
11164+
"PhoneAreaCode": "212",
11165+
"PhoneCountryCode": ""
11166+
}
11167+
],
11168+
"UpdatedDateUTC": "\/Date(1553672800957+0000)\/",
11169+
"ContactGroups": [
11170+
{
11171+
"ContactGroupID": "17b44ed7-4389-4162-91cb-3dd5766e4e22",
11172+
"Name": "Oasis",
11173+
"Status": "ACTIVE",
11174+
"Contacts": [],
11175+
"HasValidationErrors": false
11176+
}
11177+
],
11178+
"IsSupplier": true,
11179+
"IsCustomer": true,
11180+
"DefaultCurrency": "NZD",
11181+
"SalesTrackingCategories": [],
11182+
"PurchasesTrackingCategories": [],
11183+
"ContactPersons": [],
11184+
"HasValidationErrors": false
11185+
},
11186+
"BrandingThemeID": "414d4a87-46d6-4cfc-ab42-4e29d22e5076",
11187+
"Status": "DRAFT",
11188+
"LineAmountTypes": "Exclusive",
11189+
"LineItems": [
11190+
{
11191+
"ItemCode": "123",
11192+
"Description": "Brand new Fender Strats",
11193+
"UnitAmount": 2500.0000,
11194+
"TaxType": "INPUT2",
11195+
"TaxAmount": 337.50,
11196+
"LineAmount": 2250.00,
11197+
"AccountCode": "630",
11198+
"Tracking": [
11199+
{
11200+
"Name": "Simpsons",
11201+
"Option": "Homer",
11202+
"TrackingCategoryID": "6a68adde-f210-4465-b0a9-0d8cc6f50762",
11203+
"TrackingOptionID": "94faf12f-f65c-4331-8004-b0b7c5a2da23"
11204+
}
11205+
],
11206+
"Quantity": 1.0000,
11207+
"DiscountRate": 10.00,
11208+
"LineItemID": "8a9d3eca-e052-43bc-9b87-221d0648c045"
11209+
}
11210+
],
11211+
"SubTotal": 2250.00,
11212+
"TotalTax": 337.50,
11213+
"Total": 2587.50,
11214+
"UpdatedDateUTC": "\/Date(1553626029823+0000)\/",
11215+
"HasAttachments": true,
11216+
"Attachments": [
11217+
{
11218+
"AttachmentID": "7d94ccdc-ef7b-4806-87ac-8442f25e593b",
11219+
"FileName": "HelloWorld.png",
11220+
"Url": "https://api.xero.com/api.xro/2.0/PurchaseOrders/15369a9f-17b6-4235-83c4-0029256d1c37/Attachments/HelloWorld.png",
11221+
"MimeType": "image/png",
11222+
"ContentLength": 76091
11223+
}
11224+
]
11225+
}
11226+
]
11227+
}'
1107711228
'/PurchaseOrders/{PurchaseOrderID}/History':
1107811229
parameters:
1107911230
- $ref: '#/components/parameters/requiredHeader'
@@ -18813,6 +18964,11 @@ components:
1881318964
type: array
1881418965
items:
1881518966
$ref: '#/components/schemas/Allocation'
18967+
AppliedAmount:
18968+
description: The amount of applied to an invoice
18969+
type: number
18970+
format: double
18971+
example: 2.00
1881618972
Payments:
1881718973
description: See Payments
1881818974
type: array
@@ -20509,6 +20665,11 @@ components:
2050920665
type: array
2051020666
items:
2051120667
$ref: '#/components/schemas/Allocation'
20668+
AppliedAmount:
20669+
description: The amount of applied to an invoice
20670+
type: number
20671+
format: double
20672+
example: 2.00
2051220673
Payments:
2051320674
description: See Payments
2051420675
type: array
@@ -20567,6 +20728,11 @@ components:
2056720728
outstanding amount owing on the invoice e.g. 200.00
2056820729
type: number
2056920730
format: double
20731+
AppliedAmount:
20732+
description: The amount of applied to an invoice
20733+
type: number
20734+
format: double
20735+
example: 2.00
2057020736
Reference:
2057120737
description: An optional description for the payment e.g. Direct Debit
2057220738
type: string
@@ -20704,6 +20870,11 @@ components:
2070420870
type: array
2070520871
items:
2070620872
$ref: '#/components/schemas/Allocation'
20873+
AppliedAmount:
20874+
description: The amount of applied to an invoice
20875+
type: number
20876+
format: double
20877+
example: 2.00
2070720878
HasAttachments:
2070820879
description: boolean to indicate if a prepayment has an attachment
2070920880
type: boolean
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

projects-yaml/Xero-projects-1.0.0-swagger.yaml renamed to projects-yaml/Xero-projects.yaml

Lines changed: 68 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ paths:
4848
required: false
4949
description: Filter for projects in a particular state (INPROGRESS or CLOSED)
5050
schema:
51-
$ref: '#/components/schemas/Projects'
51+
type: string
5252
- name: page
5353
in: query
5454
required: false
@@ -578,6 +578,65 @@ paths:
578578
/projects/{projectId}/tasks/{taskId}:
579579
parameters:
580580
- $ref: '#/components/parameters/requiredHeader'
581+
get:
582+
security:
583+
- OAuth2: [projects, projects.read]
584+
tags:
585+
- Projects
586+
summary: Allows you to retrieve a single project
587+
operationId: getTask
588+
description: Allows you to retrieve a specific project
589+
parameters:
590+
- name: projectId
591+
in: path
592+
required: true
593+
description: You can specify an individual project by appending the projectId to the endpoint
594+
schema:
595+
type: string
596+
format: uuid
597+
- name: taskId
598+
in: path
599+
required: true
600+
description: "You can specify an individual task by appending the taskId to the endpoint, i.e. GET https://.../tasks/{taskId}"
601+
schema:
602+
type: string
603+
format: uuid
604+
responses:
605+
'200':
606+
description: OK/success, returns a list of task objects
607+
content:
608+
application/json:
609+
schema:
610+
$ref: '#/components/schemas/Task'
611+
example: '{
612+
"name": "Demolition",
613+
"rate": {
614+
"currency": "AUD",
615+
"value": 20
616+
},
617+
"chargeType": "TIME",
618+
"status": "ACTIVE",
619+
"estimateMinutes": 12000,
620+
"taskId": "7be77337-feec-4458-bb1b-dbaa5a4aafce",
621+
"projectId": "b021e7cb-1903-4292-b48b-5b27b4271e3e",
622+
"totalMinutes": 300,
623+
"totalAmount": {
624+
"currency": "AUD",
625+
"value": 100
626+
},
627+
"minutesToBeInvoiced": 300,
628+
"minutesInvoiced": 0,
629+
"nonChargeableMinutes": 0,
630+
"fixedMinutes": 0,
631+
"amountToBeInvoiced": {
632+
"currency": "AUD",
633+
"value": 100
634+
},
635+
"amountInvoiced": {
636+
"currency": "AUD",
637+
"value": 0
638+
}
639+
}'
581640
# put:
582641
# security:
583642
# - OAuth2: [projects, projects.read]
@@ -701,8 +760,10 @@ paths:
701760
- name: states
702761
in: query
703762
description: "Comma-separated list of states to find. Will find all time entries that are in the status of whatever’s specified. "
704-
schema:
705-
type: string
763+
schema:
764+
type: array
765+
items:
766+
type: string
706767
- name: isChargeable
707768
in: query
708769
description: "Finds all time entries which relate to tasks with the charge type `TIME` or `FIXED`."
@@ -1438,7 +1499,10 @@ components:
14381499
description: The date time that time entry is created. UTC Date Time in ISO-8601 format. By default it is set to server time.
14391500
duration:
14401501
type: integer
1441-
description: The duration of logged minutes. description A description of the time entry.
1502+
description: The duration of logged minutes.
1503+
description:
1504+
type: string
1505+
description: A description of the time entry.
14421506
status:
14431507
type: string
14441508
enum:

0 commit comments

Comments
 (0)