Appearance
POST legal_entity_applications/[id]/pay/coupon
Apply a coupon code to pay for a legal entity application and automatically submit it for processing.
Endpoint
POST /api/v1/legal_entity_applications/{id}/pay/couponAuthentication
Requires a valid API key in the Authorization header:
Authorization: Bearer <your-api-key>Prerequisites
- The application must be in "Draft" status
- The application must have been created via API
- The Articles of Incorporation must be signed (signature required)
- The coupon must provide full coverage of the application fees
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The unique identifier of the legal entity application |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
couponCode | string | Yes | The coupon code to apply for payment |
Example Request
bash
curl -X POST https://portal.eprospera.com/api/v1/legal_entity_applications/12345678-abcd-1234-abcd-123456789012/pay/coupon \
-H "Authorization: Bearer <your-api-key>" \
-H "Content-Type: application/json" \
-d '{
"couponCode": "STARTUP100"
}'Response
Success Response (200 OK)
| Field | Type | Description |
|---|---|---|
success | boolean | Always true for successful operations |
data | object | Updated application object |
Application Object Fields
| Field | Type | Description |
|---|---|---|
id | string | Application unique identifier |
statusId | string | Updated status (typically "Submitted") |
applicationData | object | Complete application data |
applicationVersion | string | Version of the application format |
submittedAt | string | Submission timestamp (ISO 8601) |
createdAt | string | Creation timestamp (ISO 8601) |
approvedAt | string | null | Approval timestamp if approved |
rejectedAt | string | null | Rejection timestamp if rejected |
Example Response
json
{
"success": true,
"data": {
"id": "12345678-abcd-1234-abcd-123456789012",
"statusId": "Submitted",
"applicationData": { ... },
"applicationVersion": "1.0.0",
"submittedAt": "2024-01-15T11:30:00.000Z",
"createdAt": "2024-01-15T09:15:00.000Z",
"approvedAt": null,
"rejectedAt": null
}
}Error Responses
400 Bad Request
Application not in draft status:
json
{
"error": "Legal entity application is not in draft status"
}Application not created via API:
json
{
"error": "This endpoint can only be used for API-created applications"
}Missing signature:
json
{
"error": "Signature is required before payment can be processed"
}Invalid coupon (insufficient coverage):
json
{
"error": "Coupon does not provide full coverage of application fees"
}401 Unauthorized
Invalid or missing API key:
json
{
"error": "Invalid API key"
}404 Not Found
Application not found or you don't have access:
json
{
"error": "Legal entity application not found"
}500 Internal Server Error
Server error:
json
{
"error": "Internal server error"
}How It Works
This endpoint performs several operations in sequence:
- Validates Prerequisites: Ensures the application is in the correct state and was created via API
- Checks Signature: Verifies that the Articles of Incorporation have been signed
- Creates Invoice: Generates an invoice for the application fees if one doesn't exist
- Applies Coupon: Applies the coupon code to the invoice with full coverage requirements
- Submits Application: Automatically submits the application for processing
Coupon Requirements
- The coupon must be valid and not expired
- The coupon must provide full coverage of all application fees
- If the application is already fully paid, the operation will succeed without error (idempotent)
- Partial coverage coupons will be rejected
Status Transition
After successful payment and submission, the application status typically transitions from:
"Draft"→"Submitted"
The application will then be processed by the Próspera team and may transition through additional statuses like "Under Review", "Approved", or "Rejected".
Important Notes
- This endpoint is only available for applications created via the API
- The signature step must be completed before calling this endpoint
- Once submitted, the application cannot be modified
- You can track the application status using the
GET /legal_entity_applications/{id}endpoint