Differences

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

Link to this comparison view

Next revision
Previous revision
api:api_applications_id_invoices [2023/11/08 11:57] – created Safakapi:api_applications_id_invoices [2024/07/30 11:50] (current) – external edit 127.0.0.1
Line 33: Line 33:
             "name": "Default invoice series"             "name": "Default invoice series"
         },         },
-        "applicant": "/api/v4/applicants/2", +        "applicant": "/api/applicants/2", 
-        "application": "/api/v4/applications/2",+        "application": "/api/applications/2",
         "course": null,         "course": null,
         "deadline": "2023-08-15",         "deadline": "2023-08-15",
Line 68: Line 68:
             "name": "Shopping invoice series"             "name": "Shopping invoice series"
         },         },
-        "applicant": "/api/v4/applicants/2", +        "applicant": "/api/applicants/2", 
-        "application": "/api/v4/applications/2", +        "application": "/api/applications/2", 
-        "course": null,+        "course": "/api/courses/5",
         "deadline": "2023-08-15",         "deadline": "2023-08-15",
         "issued": "2023-04-28T08:00:00+00:00",         "issued": "2023-04-28T08:00:00+00:00",
Line 96: Line 96:
     }     }
   }   }
 +  
 +  
 +===== POST =====
 +
 +Create a new invoice attached to the application in question. The URI for the invoice created is returned in the ''Location'' header.
 +
 +==== Syntax ====
 +
 +  POST /api/application/123/invoices
 +  Host: apply.example.edu
 +  Authorization: DREAM apikey="..."
 +  
 +==== Parameters ====
 +
 +^ Name ^  ^ Description ^
 +| ''currency'' | **Required** | Invoice currency. |
 +| ''items'' | **Required** | Invoice items/rows. |
 +| ''invoice_class_ID'' | **Optional** | ID of the invoice class resource, whose attributes/settings will be used as a template for the new invoice. |
 +
 +==== Raw request body ====
 +
 +The parameters above should be sent as a proper JSON object.
 +
 +  {
 +    "invoice_class_ID": 1,
 +    "currency": "EUR",
 +    "items": [
 +      {
 +        "item": "Application fee",
 +        "price": "100.00",
 +        "qty": "1",
 +        "unit": null
 +      },
 +      {
 +        "item": "City excursion fee",
 +        "price": "25.00",
 +        "qty": "1",
 +        "unit": null
 +      }
 +    ]
 +  }
 +==== Response headers ====
 +
 +  Content-Type: application/json
 +  Content-Length: 0
 +  Location: /api/applicants/trackers/TEST
 +
 +==== Response codes ====
 +
 +| ''201 Created'' | New invoice was created |