Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
api:api_invoices [2014/07/12 12:59] – created Lauri Elevantapi:api_invoices [2023/09/21 20:31] (current) – [Parameters] Lauri Elevant
Line 1: Line 1:
 +====== /api/invoices ======
 +
 +===== HEAD, GET =====
 +
 +List invoices using the filters set as parameters. The number of invoices is represented in the ''X-Count'' header - use the ''HEAD'' request to simply count the number of invoices matching the filters. Use the ''GET'' request to actually fetch them.
 +
 +==== Syntax ====
 +
 +  GET /api/invoices
 +  Host: apply.example.edu
 +  Authorization: DREAM apikey="..."
 +
 ==== Parameters ==== ==== Parameters ====
  
 ^ Name ^  ^ Description ^ Notes ^ ^ Name ^  ^ Description ^ Notes ^
-| ''byCitizenships'' | Optional | List of [[http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2|ISO 3166-1 alpha-2 country codes]] [1] +| ''byIssuedSince'' | Optional | ISO 8601 datetimeOnly show invoices issued after this| | 
-| ''byTrackerIDs'' | Optional | List of [[api:api_applicants_trackers|tracker ID-s]] | [1] [2] | +| ''byCollectedSince'' | Optional | ISO 8601 datetime. Only show invoices collected after this. | | 
-| ''byTrackerCodes'' | Optional | List of [[api:api_applicants_trackers|tracker codes]] | [1] [2] |+| ''byApplicantIDs'' | Optional | List of [[api:api_applicants|applicant ID-s]] | [1] | 
 +| ''bySerieIDs'' | Optional | List of [[api:api_invoices_series|serie ID-s]] | [1] 
 +| ''byCurrencies'' | Optional | List of 3-letter currency symbols | [1
 +| ''byCollected'' | Optional | Set ''true'' to only fetch invoices that have been collected. Set ''false'' to only fetch invoices that have not been collected yet. | | 
 +| ''byOverdue'' | Optional | Set ''true'' to only fetch invoices that are overdue (not collected and deadline has passed). Set ''false'' to fetch invoices that are not overdue (collected or deadline not yet arrived). | |
  
   * // Note [1]: Lists can be either comma or space separated. All list items are combined with logical ''OR'' operators - in other words an application is considered matching if it matches to any of the values in the list.//   * // Note [1]: Lists can be either comma or space separated. All list items are combined with logical ''OR'' operators - in other words an application is considered matching if it matches to any of the values in the list.//
-  * //Note [2]: you may use either tracker ID-s or codes to reference trackersHowever ID-s are guaranteed not to change while the tracker codes offer no such guarantee//+ 
 +==== Response headers ==== 
 + 
 +  Content-Type: application/json 
 +  Content-Length: 1234 
 +  X-Count: 15 
 + 
 + 
 +==== Response example ==== 
 + 
 +  { 
 +    "1":
 +        "nr": "TUIT-123/2014", 
 +        "applicant": "/api/applicants/65", 
 +        "issued": "2014-07-12T12:09:42+00:00", 
 +        "delivered": "2014-07-12T12:09:57+00:00", 
 +        "deadline": "2019-09-17" 
 +        "reminded": null, 
 +        "collected": null, 
 +        "items": [ 
 +            { 
 +                "item": "Tuition fee", 
 +                "price": "1899", 
 +                "qty": "1", 
 +                "unit": "-" 
 +            } 
 +        ]
 +        "collections"
 +            { 
 +                "inserted": "2014-07-12T12:09:42+00:00", 
 +                "collected": "2014-07-12", 
 +                "amount": "50.55", 
 +                "administrator": "/api/administrators/123" 
 +            } 
 +        ], 
 +        "currency": "EUR", 
 +        "instructions": "dfgsdfgs dfgs\r\ndfg\r\nsdfg\r\nsd\r\nfgsdfgsdfgsdfg", 
 +        "smallprint": "Please make sure that you include the invoice number in the payment transaction. Otherwise the payment may not get properly processed.\r\n\r\nThis invoice has been issued electronically and is valid without a signature. The invoice is issued in accordance to the region that you specified during your registrationIf the region (and the currency) is not correct, please contact us for re-issuance." 
 +    }, 
 +    "2":
 +        "nr": "APPF-223/2014", 
 +        "applicant": "/api/applicants/65", 
 +        "issued": "2014-07-17T10:54:19+00:00", 
 +        "delivered": "2014-07-17T10:54:19+00:00", 
 +        "deadline": "2019-09-17" 
 +        "reminded": null, 
 +        "collected": null, 
 +        "items":
 +            { 
 +                "item": "Appfee", 
 +                "price": "44", 
 +                "qty": "1", 
 +                "unit": "-" 
 +            } 
 +        ], 
 +        "collections": [], 
 +        "currency": "EUR", 
 +        "instructions": "", 
 +        "smallprint": "Please make sure that you include the invoice number in the payment transaction. Otherwise the payment may not get properly processed.\r\n\r\nThis invoice has been issued electronically and is valid without a signature. The invoice is issued in accordance to the region that you specified during your registrationIf the region (and the currency) is not correct, please contact us for re-issuance." 
 +    }, 
 +  }