Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
api:api_applications_id_invoices [2023/11/08 12:11] Safakapi:api_applications_id_invoices [2024/07/30 11:50] (current) – external edit 127.0.0.1
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 |