Skip to content

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/coupon

Authentication

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

ParameterTypeRequiredDescription
idstringYesThe unique identifier of the legal entity application

Request Body

FieldTypeRequiredDescription
couponCodestringYesThe 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)

FieldTypeDescription
successbooleanAlways true for successful operations
dataobjectUpdated application object

Application Object Fields

FieldTypeDescription
idstringApplication unique identifier
statusIdstringUpdated status (typically "Submitted")
applicationDataobjectComplete application data
applicationVersionstringVersion of the application format
submittedAtstringSubmission timestamp (ISO 8601)
createdAtstringCreation timestamp (ISO 8601)
approvedAtstring | nullApproval timestamp if approved
rejectedAtstring | nullRejection 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:

  1. Validates Prerequisites: Ensures the application is in the correct state and was created via API
  2. Checks Signature: Verifies that the Articles of Incorporation have been signed
  3. Creates Invoice: Generates an invoice for the application fees if one doesn't exist
  4. Applies Coupon: Applies the coupon code to the invoice with full coverage requirements
  5. 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