# Subscription Management



# Create Subscription

Use this API to create a new subscription. After a successful request, the response will include a payment link that you must redirect your customer to in order to complete the subscription setup. 

### Endpoint

``` 
POST https://demo-api.frontpayment.no/api/v1/connect/subscriptions/submit
```

### Authentication

This endpoint requires a `Bearer Token` for authentication. You will need to obtain this token from Front Payment and include it in the `Authorization` header of your request.

**Example Authorization Header:**
`Authorization: Bearer YOUR_FRONTPAID_BEARER_TOKEN`

### Request Payload

The request body should be a JSON object including the following elements:

```json
{
  "products": [
    {
      "name": "string",
      "productId": "string or null",
      "quantity": number,
      "rate": number,
      "discount": number (optional),
      "tax": number,
      "amount": number
    }
  ],
  "billingFrequency": "string",
  "numberOfRepeats": number,
  "orderSummary": {
    "subTotal": number,
    "totalTax": number,
    "totalDiscount": number,
    "grandTotal": number,
    "payablePerCycle": number
  },
  "subscriptionStartDate": "string",
  "subscriptionEndsDate": "string",
  "dueDateForPaymentLink": "string",
  "sendOrderBy": {
    "sms": boolean,
    "email": boolean
  },
  "customerDetails": {
    "type": "string or null",
    "countryCode": "string or null",
    "msisdn": "string or null",
    "email": "string or null (must be email format)",
    "name": "string",
    "personalNumber": "string or null",
    "organizationId": "string or null (when type=corporate)",
    // (other fields like preferredLanguage or address may apply in checkout session—refer to specific endpoints)
  }
}
```

### Validation Rules

The following table outlines validation constraints for each field in the request payload:

<table>
  <thead>
    <tr>
      <th>Field</th>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code>products.*.name</code></td>
      <td><code>string</code></td>
      <td><strong>Required</strong>. Name of the product.</td>
    </tr>
    <tr>
      <td><code>products.*.productId</code></td>
      <td><code>string</code></td>
      <td><strong>Optional</strong>. Unique identifier for the product.</td>
    </tr>
    <tr>
      <td><code>products.*.quantity</code></td>
      <td><code>numeric</code></td>
      <td><strong>Required</strong>. Quantity of the product.</td>
    </tr>
    <tr>
      <td><code>products.*.rate</code></td>
      <td><code>numeric</code></td>
      <td><strong>Required</strong>. Rate per unit of the product.</td>
    </tr>
    <tr>
      <td><code>products.*.discount</code></td>
      <td><code>numeric</code></td>
      <td><strong>Optional</strong>. Discount applied to the product.</td>
    </tr>
    <tr>
      <td><code>products.*.tax</code></td>
      <td><code>numeric</code></td>
      <td><strong>Required</strong>. Tax rate (e.g., 0, 12, 15, 25). Unless you have other configuration.</td>
    </tr>
    <tr>
      <td><code>products.*.amount</code></td>
      <td><code>numeric</code></td>
      <td><strong>Required</strong>. Total amount for the product line item.</td>
    </tr>
    <tr>
      <td><code>billingFrequency</code></td>
      <td><code>string</code></td>
      <td><strong>Required</strong> Defines how often the billing occurs (e.g., daily, weekly, monthly)</td>
    </tr>
    <tr>
      <td><code>numberOfRepeats</code></td>
      <td><code>numeric</code></td>
      <td><strong>Required</strong>Specifies how many times the billing cycle should be repeated.</td>
    </tr>
    <tr>
      <td><code>orderSummary.subTotal</code></td>
      <td><code>numeric</code></td>
      <td><strong>Required</strong>. Subtotal of all products before tax and discount.</td>
    </tr>
    <tr>
      <td><code>orderSummary.totalTax</code></td>
      <td><code>numeric</code></td>
      <td><strong>Required</strong>. Total tax for the order.</td>
    </tr>
    <tr>
      <td><code>orderSummary.totalDiscount</code></td>
      <td><code>numeric</code></td>
      <td><strong>Required</strong>. Total discount for the order.</td>
    </tr>
    <tr>
      <td><code>orderSummary.grandTotal</code></td>
      <td><code>numeric</code></td>
      <td><strong>Required</strong>. Grand total of the order.</td>
    </tr>
    <tr>
      <td><code>orderSummary.payablePerCycle</code></td>
      <td><code>numeric</code></td>
      <td><strong>Required</strong>Amount to be paid by the customer for each billing cycle.</td>
    </tr>
    <tr>
      <td><code>subscriptionStartDate</code></td>
      <td><code>string</code></td>
      <td><strong>Required</strong> The date when the subscription becomes active.</td>
    </tr>
    <tr>
      <td><code>subscriptionEndsDate</code></td>
      <td><code>string</code></td>
      <td><strong>Required</strong> The end date of subscription</td>
    </tr>
    <tr>
      <td><code>dueDateForPaymentLink</code></td>
      <td><code>string</code></td>
      <td><strong>Required</strong>. Unix timestamp for the due date of the payment link.</td>
    </tr>
    <tr>
      <td><code>sendOrderBy.sms</code></td>
      <td><code>boolean</code></td>
      <td><strong>Required</strong> If the payment link should send via sms</td>
    </tr>
    <tr>
      <td><code>sendOrderBy.email</code></td>
      <td><code>boolean</code></td>
      <td><strong>Required</strong> If the payment link should send via email</td>
    </tr>
    <tr>
      <td><code>customerDetails.type</code></td>
      <td><code>string</code></td>
      <td><strong>Required</strong>. Customer type must be either <code>private</code> or <code>corporate</code>.</td>
    </tr>
    <tr>
      <td><code>customerDetails.countryCode</code></td>
      <td><code>string</code></td>
      <td><strong>Required</strong>. Country code for the customer's phone number (e.g., "+47")</td>
    </tr>
    <tr>
      <td><code>customerDetails.msisdn</code></td>
      <td><code>string</code></td>
      <td><strong>Required</strong>. Mobile Subscriber ISDN Number (phone number).</td>
    </tr>
    <tr>
      <td><code>customerDetails.email</code></td>
      <td><code>email</code></td>
      <td><strong>Required</strong>. Customer's email address.</td>
    </tr>
    <tr>
      <td><code>customerDetails.name</code></td>
      <td><code>string</code></td>
      <td><strong>Required</strong>. Customer's full name.</td>
    </tr>
    <tr>
      <td><code>customerDetails.personalNumber</code></td>
      <td><code>string</code></td>
      <td><strong>Optional</strong> Customer's personal identification number, must be 11 characters</td>
    </tr>
    <tr>
      <td><code>customerDetails.organizationId</code></td>
      <td><code>string</code></td>
      <td><strong>Required</strong> if <code>customerDetails.type</code> is <code>corporate</code>. Must be number</td>
    </tr>
  </tbody>
</table>

### Responses

#### Successful Response

On success, you’ll receive a JSON response containing the status and a payment link to redirect the user:

```json
{
  "status_code": 200,
  "status_message": "OK",
  "message": "subscriptionCreatedSuccessfully",
  "is_data": true,
  "data": {
    "paymentLink": "https://…",
    "subscriptionUuid": "…",
    "orderUuid": "…",
    // Possibly other metadata
  }
}
```

You must redirect the customer to `paymentLink` to finalize the subscription. ([docs.frontpayment.no][1])

#### Error Responses

* **401 Unauthorized**: Missing or invalid Bearer token.
* Other validation errors will return appropriate HTTP error codes (e.g., `400 Bad Request`) along with error messages specifying the invalid or missing fields.

# Create Session For Subscription Payment

Use this API endpoint to create a new subscription using the checkout modality. Upon a successful request, you'll receive a `paymentUrl` that your application must redirect the customer to in order to complete the subscription setup.

### Endpoint

* **URL:** `https://demo-api.frontpayment.no/api/v1/connect/subscription/create` ([docs.frontpayment.no][2])
* **Method:** `POST`

### Authentication

Requires **Bearer Token** authentication. Include the token in the `Authorization` header:

```
Authorization: Bearer YOUR_ACCESS_TOKEN
```

If the token is missing or invalid, the API returns a `401 Unauthorized` response. ([docs.frontpayment.no][1])

### Request Payload

The body must be JSON and include fields such as products, billing schedule, customer details, callback URLs, etc. Here's a condensed example:

```json
{
  "products": {
    "0": {
      "name": "product 3",
      "productId": null,
      "quantity": "1",
      "rate": "2000",
      "discount": 0,
      "tax": "0",
      "amount": 2000
    }
  },
  "orderSummary": {
    "subTotal": "2000.00",
    "totalTax": "0.00",
    "totalDiscount": "0.00",
    "grandTotal": "2000.00",
    "payablePerCycle": "2000.00"
  },
  "billingFrequency": "month",
  "numberOfRepeats": 12,
  "subscriptionStartDate": "21 Feb, 2023",
  "subscriptionEndsDate": "21 Feb, 2024",
  "dueDateForPaymentLink": "1677047770.652",
  "customerDetails": {
    "customerUuid": "CSRT3798554634",
    "type": "private",
    "countryCode": "+47",
    "msisdn": "46567468",
    "email": "[email protected]",
    "name": "Kari Nordmann",
    "personalNumber": null,
    "organizationId": "925710482",
    "preferredLanguage": "no",
    "address": {
      "street": "Luramyrveien 65",
      "zip": "4313",
      "city": "Sandnes",
      "country": "Norway"
    }
  },
  "customerNotes": "test",
  "termsAndConditions": "terms and conditions",
  "submitPayment": {
    "via": "visa",
    "currency": "NOK"
  },
  "callback": {
    "success": "https://demo.frontpayment.no/?order_identifier=...&order_status=success",
    "failure": "https://demo.frontpayment.no/?order_identifier=...&order_status=failed"
  }
}
```

([docs.frontpayment.no][1])

### Validation Rules

Below are the validation constraints for each field:

<table>
  <thead>
    <tr>
      <th>Field</th>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr><td><code>products.*.name</code></td><td><code>string</code></td><td><strong>Required</strong></td></tr>
    <tr><td><code>products.*.productId</code></td><td><code>string</code></td><td><strong>Optional</strong>, max length 25</td></tr>
    <tr><td><code>products.*.quantity</code></td><td><code>numeric</code></td><td><strong>Required</strong></td></tr>
    <tr><td><code>products.*.rate</code></td><td><code>numeric</code></td><td><strong>Required</strong></td></tr>
    <tr><td><code>products.*.discount</code></td><td><code>numeric</code></td><td><strong>Optional</strong></td></tr>
    <tr><td><code>products.*.tax</code></td><td><code>numeric</code></td><td><strong>Required</strong></td></tr>
    <tr><td><code>products.*.amount</code></td><td><code>numeric</code></td><td><strong>Required</strong></td></tr>
    <tr><td><code>billingFrequency</code></td><td><code>string</code></td><td><strong>Required</strong> (e.g., monthly, weekly, daily)</td></tr>
    <tr><td><code>numberOfRepeats</code></td><td><code>numeric</code></td><td><strong>Required</strong></td></tr>
    <tr><td><code>orderSummary.subTotal</code></td><td><code>numeric</code></td><td><strong>Required</strong></td></tr>
    <tr><td><code>orderSummary.totalTax</code></td><td><code>numeric</code></td><td><strong>Required</strong></td></tr>
    <tr><td><code>orderSummary.totalDiscount</code></td><td><code>numeric</code></td><td><strong>Required</strong></td></tr>
    <tr><td><code>orderSummary.grandTotal</code></td><td><code>numeric</code></td><td><strong>Required</strong></td></tr>
    <tr><td><code>orderSummary.payablePerCycle</code></td><td><code>numeric</code></td><td><strong>Required</strong></td></tr>
    <tr><td><code>subscriptionStartDate</code></td><td><code>string</code></td><td><strong>Required</strong></td></tr>
    <tr><td><code>subscriptionEndsDate</code></td><td><code>string</code></td><td><strong>Required</strong></td></tr>
    <tr><td><code>dueDateForPaymentLink</code></td><td><code>string</code></td><td><strong>Required</strong></td></tr>
    <tr><td><code>customerDetails.type</code></td><td><code>string</code></td><td><strong>Required</strong> (nullable)</td></tr>
    <tr><td><code>customerDetails.countryCode</code></td><td><code>string</code></td><td><strong>Required</strong> (nullable)</td></tr>
    <tr><td><code>customerDetails.msisdn</code></td><td><code>string</code></td><td><strong>Required</strong> (nullable)</td></tr>
    <tr><td><code>customerDetails.email</code></td><td><code>email</code></td><td><strong>Required</strong> (nullable)</td></tr>
    <tr><td><code>customerDetails.name</code></td><td><code>string</code></td><td><strong>Required</strong></td></tr>
    <tr><td><code>customerDetails.personalNumber</code></td><td><code>string</code></td><td><strong>Optional</strong>, Customer's personal identification number, must be 11 characters.</td></tr>
    <tr><td><code>customerDetails.organizationId</code></td><td><code>string</code></td><td><strong>Required</strong> if type=corporate, <strong>Optional</strong>, regex /^[a-zA-Z0-9]+$/</td></tr>
    <tr><td><code>customerDetails.preferredLanguage</code></td><td><code>string</code></td><td><strong>Required</strong></td></tr>
    <tr><td><code>customerDetails.address</code></td><td><code>array</code></td><td><strong>Required</strong></td></tr>
    <tr><td><code>customerDetails.address.street</code></td><td><code>string</code></td><td><strong>Required</strong></td></tr>
    <tr><td><code>customerDetails.address.zip</code></td><td><code>string</code></td><td><strong>Required</strong></td></tr>
    <tr><td><code>customerDetails.address.city</code></td><td><code>string</code></td><td><strong>Required</strong></td></tr>
    <tr><td><code>customerDetails.address.country</code></td><td><code>string</code></td><td><strong>Required</strong>, ISO Alpha-2 country code</td></tr>
    <tr><td><code>customerNotes</code></td><td><code>string</code></td><td><strong>Optional</strong></td></tr>
    <tr><td><code>termsAndConditions</code></td><td><code>string</code></td><td><strong>Optional</strong></td></tr>
    <tr><td><code>submitPayment.currency</code></td><td><code>string</code></td><td><strong>Required</strong></td></tr>
    <tr><td><code>submitPayment.via</code></td><td><code>string</code></td><td><strong>Optional</strong></td></tr>
    <tr><td><code>settings</code></td><td><code>array</code></td><td><strong>Optional</strong></td></tr>
    <tr><td><code>settings.secureDetails</code></td><td><code>boolean</code></td><td><strong>Optional</strong></td></tr>
    <tr><td><code>callback.success</code></td><td><code>url</code></td><td><strong>Required</strong></td></tr>
    <tr><td><code>callback.failure</code></td><td><code>url</code></td><td><strong>Required</strong></td></tr>
  </tbody>
</table>  
:contentReference[oaicite:4]{index=4}

### Response

#### Success

Returns HTTP status `201` with a payload like:

```json
{
  "status_code": 201,
  "status_message": "OK",
  "message": "subscriptionRequestSuccessfullyHandled",
  "is_data": true,
  "data": {
    "subscriptionUuid": "SUB1812030514",
    "orderUuid": "ODR3798113293",
    "customerUuid": "CSRT3820359602",
    "paymentUrl": "https://..."
  }
}
```

([docs.frontpayment.no][1])

#### Error Responses

* **510 Execution Exception** – Internal processing error:

  ```json
  {
    "status_code": 510,
    "status_message": "Execution Exception Occurred",
    "message": "Internal Error Occurred Please Try Again Later",
    "is_error": true,
    "errors": [...]
  }
  ```
* **500 Internal Dependency Error** – Critical failure in dependency:

  ```json
  {
    "status_code": 500,
    "status_message": "Internal Dependency Error",
    "message": "Internal Error Occurred Please Try Again Later",
    "is_error": true,
    "errors": [
      {
        "happenedAt": "String",
        "internalErrorDetails": "String"
      }
    ]
  }
  ```

# Get Subscription List

**Description:**  
Retrieves a paginated list of subscriptions. The response includes details of each subscription, and filtering options can be applied via query parameters.

**Url Parameter Parameters:**

- `status` (string, optional) – Filter subscriptions by status (e.g., `SENT`, `ONGOING`, `COMPLETED, CANCELLED`).

**Query Parameters:**

- `page` (integer, optional) – The page number for pagination. Default: `1`.
- `phone` (string, optional) – Filter subscriptions by phone.
- `customerName` (string, optional) – Retrieve subscriptions associated with a specific customer.
- `startDate` (date, optional) – Filter subscriptions that started on or after this date (Format: `YYYY-MM-DD`).
- `endDate` (date, optional) – Filter subscriptions that ended on or before this date (Format: `YYYY-MM-DD`). startDate and endDate should be used together.

**Authentication**

This endpoint requires authentication using a **Bearer Token**. The client must send the token in the `Authorization` header for every request.

**Example Authentication Header:**

<div class="contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950" id="bkmrk-authorization%3A-beare"><div class="overflow-y-auto p-4" dir="ltr">`<span class="hljs-section">Authorization: Bearer YOUR_ACCESS_TOKEN</span>`</div></div>If the token is missing or invalid, the API will return a `401 Unauthorized` response.

<table border="1" id="bkmrk-endpoint-%3A-https%3A%2F%2Fd" style="border-collapse: collapse; width: 100%; height: 1160.85px;"><colgroup><col style="width: 33.3745%;"></col><col style="width: 2.22497%;"></col><col style="width: 64.4005%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Endpoint</td><td style="height: 29.7969px;">:</td><td style="height: 29.7969px;"><span data-offset-key="ftu67-3-0"><span data-text="true">[https://demo-api.frontpayment.no/api/v1/connect/subscriptions/list/](https://demo-api.frontpayment.no/api/v1/connect/subscriptions/list/){status?}</span></span></td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Method</td><td style="height: 29.7969px;">:</td><td style="height: 29.7969px;">GET</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Authorization</td><td style="height: 29.7969px;">:</td><td style="height: 29.7969px;">Bearer</td></tr><tr style="height: 486.094px;"><td style="height: 486.094px;" valign="top" width="132">Response Structure

</td><td style="height: 486.094px;" valign="top" width="18">: </td><td style="height: 486.094px;">```json
{
  "status_code": 200,
  "status_message": "OK",
  "message": "subscriptionRetrieveSuccessfully",
  "is_data": true,
  "data": [
    {
      "subscriptionUuid": "String",
      "orderUuid": "String",
      "repeats": "Integer",
      "frequency": "String",
      "amount": "Float",
      "currency": "String",
      "createdAt": "String",
      "customerName": "String",
      "clientName": "String",
      "customerEmail": "String",
      "countryCode": "String",
      "msisdn": "String",
      "status": "String",
      "isPaid": "Boolean",
      "isRefundable": "Boolean",
      "numberOfPaidCycles": "Integer"
    }
  ],
  "metaData": {
    "total": "Integer",
    "perPage": "Integer",
    "currentPage": "Integer",
    "lastPage": "Integer"
  },
  "links": {
    "previous": null,
    "next": "https://fpgo-backend.test/api/v1/connect/subscriptions/failed/list?page=2"
  }
}
```

  
</td></tr><tr style="height: 486.094px;"><td style="height: 486.094px;" valign="top" width="132">Example Response

</td><td style="height: 486.094px;" valign="top" width="18">: </td><td style="height: 486.094px;">```json
{
    "status_code": 200,
    "status_message": "OK",
    "message": "subscriptionRetrieveSuccessfully",
    "is_data": true,
    "data": [
     
        {
            "subscriptionUuid": "SUB3959080783",
            "orderUuid": "ODR1530327942",
            "repeats": 12,
            "frequency": "month",
            "amount": 2000,
            "currency": "NOK",
            "createdAt": "07.11.2023",
            "customerName": "420 Test",
            "clientName": "Front Payment AS",
            "customerEmail": "local-420test@yopmail.com",
            "countryCode": "+47",
            "msisdn": "46567468",
            "status": "EXPIRED",
            "isPaid": false,
            "isRefundable": false,
            "numberOfPaidCycles": 0,
        },
        {
            "subscriptionUuid": "SUB4132380543",
            "orderUuid": "ODR2167679196",
            "repeats": 12,
            "frequency": "month",
            "amount": 2000,
            "currency": "NOK",
            "createdAt": "05.11.2023",
            "customerName": "420 Test",
            "clientName": "Front Payment AS",
            "customerEmail": "local-420test@yopmail.com",
            "countryCode": "+47",
            "msisdn": "46567468",
            
            "status": "ONGOING",
            "isPaid": true,
            "isRefundable": true,
             "numberOfPaidCycles": 4,
        },
        {
            "subscriptionUuid": "SUB2007828928",
            "orderUuid": "ODR187366332",
            "repeats": 12,
            "frequency": "month",
            "amount": 2000,
            "currency": "NOK",
            "createdAt": "05.11.2023",
            "customerName": "420 Test",
            "clientName": "Front Payment AS",
            "customerEmail": "local-420test@yopmail.com",
            "countryCode": "+47",
            "msisdn": "46567468",
            "status": "ONGOING",
            "isPaid": true,
            "isRefundable": true,
            "numberOfPaidCycles": 1,
        },
      ....
    ],
    "metaData": {
        "total": 3,
        "perPage": 50,
        "currentPage": 1,
        "lastPage": 1
    },
    "links": {
        "previous": null,
        "next": "https://fpgo-backend.test/api/v1/connect/subscriptions/list?page=2"
    }
}
```

</td></tr></tbody></table>

# Get Failed Payment List

**Description:**  
Retrieves a paginated list of failed subscription orders. The response includes details of each subscription order, and filtering options can be applied via query parameters.

**Url Parameter Parameters:**

- `status` (string, optional) – Filter subscriptions by status (e.g., paid, invoiced, debtCollection).

**Query Parameters:**

- `page` (integer, optional) – The page number for pagination. Default: `1`.
- `subscriptionUuid` (string, optional) – Retrieve subscriptions associated with a specific subscription.
- `phone` (string, optional) – Filter subscriptions order by customer phone.
- `customerName` (string, optional) – Retrieve subscriptions associated with a specific customer name.
- `startDate` (date, optional) – Filter subscription order that started on or after this date (Format: `YYYY-MM-DD`).
- `endDate` (date, optional) – Filter subscription order that ended on or before this date (Format: `YYYY-MM-DD`). startDate and endDate should be used together.

**Authentication**

This endpoint requires authentication using a **Bearer Token**. The client must send the token in the `Authorization` header for every request.

**Example Authentication Header:**

<div class="contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950" id="bkmrk-authorization%3A-beare"><div class="overflow-y-auto p-4" dir="ltr">`<span class="hljs-section">Authorization: Bearer YOUR_ACCESS_TOKEN</span>`</div></div><div aria-label="Page Section Options" class="pointer-container" id="bkmrk-%C2%A0" refs="pointer@pointer" tabindex="-1"><div class="pointer flex-container-row items-center justify-space-between p-s anim is-page-editable"><div class="flex-container-row items-center gap-s" refs="pointer@mode-section"><button class="text-button icon px-xs" title="Permalink mode, Press to show include tag"><svg class="svg-icon" data-icon="link" role="presentation" viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"></svg></button><div class="input-group"> <button class="button outline icon" title="Copy Link" type="button"><svg class="svg-icon" data-icon="copy" role="presentation" viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"></svg></button></div></div><svg class="svg-icon" data-icon="edit" role="presentation" viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"></svg></div></div>If the token is missing or invalid, the API will return a `401 Unauthorized` response.

<table border="1" id="bkmrk-endpoint-%3A-https%3A%2F%2Fd" style="border-collapse: collapse; width: 100%; height: 160.172px;"><colgroup><col style="width: 25.0927%;"></col><col style="width: 3.22498%;"></col><col style="width: 71.6823%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Endpoint**</td><td style="height: 29.7969px;">**:**</td><td style="height: 29.7969px;">[https://demo-api.frontpayment.no/api/v1/connect/subscriptions/failed/list/](https://demo-api.frontpayment.no/api/v1/connect/subscriptions/list/){status?}</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Method**</td><td style="height: 29.7969px;">**:**</td><td style="height: 29.7969px;">GET</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Authorization**</td><td style="height: 29.7969px;">**:**</td><td style="height: 29.7969px;">Bearer</td></tr><tr style="height: 35.3906px;"><td style="height: 35.3906px;" valign="top" width="132">**Response Structure**

</td><td style="height: 35.3906px;">**:**</td><td style="height: 35.3906px;">```
{
    "status_code": 200,
    "status_message": "OK",
    "message": "failedSubscriptionOrdersRetrievedSuccessfully!",
    "is_data": true,
    "data": [
        {
            "orderUuid": "String",
            "orderDate": "String",
            "customerName": "String",
            "clientName": "String",
            "countryCode": "String",
            "msisdn": "String",
            "currency": "String",
            "amount": "Float",
            "status": "String",
            "translationKey": "failedSubscriptionOrderInvoiced",
            "subscriptionUuid": "String"
        },
       "metaData": {
          "total": "Integer",
          "perPage": "Integer",
          "currentPage": "Integer",
          "lastPage": "Integer"
        },
        "links": {
          "previous": null,
          "next": "https://fpgo-backend.test/api/v1/connect/subscriptions/failed/list?page=2"
        }
}
```

  
</td></tr><tr style="height: 35.3906px;"><td style="height: 35.3906px;" valign="top" width="132">**Example Response**

</td><td style="height: 35.3906px;">**:**</td><td style="height: 35.3906px;">```json
{
  "status_code": 200,
  "status_message": "OK",
  "message": "failedSubscriptionOrdersRetrievedSuccessfully!",
  "is_data": true,
  "data": [
    {
      "orderUuid": "ODR1276808511",
      "orderDate": "19.12.2024",
      "customerName": "Nafees",
      "clientName": "Sweden & Co",
      "countryCode": "+47",
      "msisdn": "46567468",
      "currency": "NOK",
      "amount": 2500,
      "status": "INVOICED",
      "translationKey": "failedSubscriptionOrderInvoiced",
      "subscriptionUuid": "SUB2532543787"
    },
    {
      "orderUuid": "ODR266110120",
      "orderDate": "19.12.2024",
      "customerName": "Nafees",
      "clientName": "Sweden & Co",
      "countryCode": "+47",
      "msisdn": "46567468",
      "currency": "NOK",
      "amount": 10,
      "status": "INVOICED",
      "translationKey": "failedSubscriptionOrderInvoiced",
      "subscriptionUuid": "SUB2642190423"
    }
  ],
  "metaData": {
    "total": 133,
    "perPage": 50,
    "currentPage": 1,
    "lastPage": 3
  },
  "links": {
    "previous": null,
    "next": "https://fpgo-backend.test/api/v1/connect/subscriptions/failed/list?page=2"
  }
}
```

  
</td></tr></tbody></table>

# Get Subscription Details By Uuid

**Description:**  
Retrieves a subscription by uuid. The response includes details of the subscription.

**Url Parameter Parameters:**

- `subscriptionUuid` (string, required)

**Authentication**

This endpoint requires authentication using a **Bearer Token**. The client must send the token in the `Authorization` header for every request.

**Example Authentication Header:**

<div class="contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950" id="bkmrk-authorization%3A-beare"><div class="overflow-y-auto p-4" dir="ltr">`<span class="hljs-section">Authorization: Bearer YOUR_ACCESS_TOKEN</span>`</div></div>If the token is missing or invalid, the API will return a `401 Unauthorized` response.

<table border="1" id="bkmrk-endpoint-%3A-https%3A%2F%2Fd" style="border-collapse: collapse; width: 110.37%; height: 225.375px;"><colgroup><col style="width: 33.3745%;"></col><col style="width: 2.96663%;"></col><col style="width: 63.6588%;"></col></colgroup><tbody><tr style="height: 46.5938px;"><td style="height: 46.5938px;">Endpoint</td><td style="height: 46.5938px;">:</td><td style="height: 46.5938px;"><span data-offset-key="9i8o9-5-0"><span data-text="true">[<span class="resolvedVariable" data-testid="resolvedVariable" spellcheck="false"><span data-offset-key="9i8o9-0-0"><span data-text="true">https://demo-api.frontpayment.no/api/v1/connect</span></span></span>/subscriptions/details/](https://demo-api.frontpayment.no/api/v1/connect/subscriptions/details/){subscriptionUuid}</span></span></td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Method</td><td style="height: 29.7969px;">:</td><td style="height: 29.7969px;">GET</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Authorization</td><td style="height: 29.7969px;">:</td><td style="height: 29.7969px;">Bearer</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Payload Validations</td><td style="height: 29.7969px;">:</td><td style="height: 29.7969px;">  
</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Example Payload</td><td style="height: 29.7969px;">:</td><td style="height: 29.7969px;">  
</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Response Structure</td><td style="height: 29.7969px;">:</td><td style="height: 29.7969px;">```json
{
    "status_code": 200,
    "status_message": "OK",
    "message": "subscriptionDetailsRetrievedSuccessfully",
    "is_data": true,
    "data": {
        "subscriptionUuid": "String",
        "status": "String",
        "subscriptionSummary": {
            "subscriptionAmount": "Float",
            "amountPaid": "Float",
            "amountRefunded": "Float",
            "amountInBank": "Float",
            "startDate": "String",
            "endDate": "String",
            "dueDateForPaymentLink": "String",
            "payablePerCycle": "Integer",
            "frequency": "String",
            "repeats": "Integer",
            "currency": "String",
            "currentCycle": "String",
            "isPaid": "Boolean",
            "isRefundable": "Boolean"
        },
        "productList": [
            {
                "id": "Integer",
                "productName": "String",
                "productId": "null|String",
                "quantity": "Integer",
                "rate": "Float",
                "discount": "Integer",
                "tax": "Integer",
                "amount": "Float"
            }
        ],
        "sendOrderBy": {
            "sms": "Boolean",
            "email": "Boolean"
        },
        "customerDetails": {
            "customerUuid": "String",
            "customerName": "String",
            "customerEmail": "String",
            "countryCode": "String",
            "msisdn": "String",
            "preferredLanguage": "String",
            "address": {
                "street": "String",
                "zip": "String",
                "city": "String",
                "country": "String"
            }
        },
        "organizationDetails": {
            "name": "String",
            "billingAddress": {
                "countryCode": "String",
                "msisdn": "String",
                "email": "String",
                "street": "String",
                "zip": "String",
                "city": "String",
                "country": "String"
            }
        },
        "subscriptionCycles": {
            "Cycle 1": {
                "reference": "String",
                "status": "String",
                "invoiced": "Boolean",
                "amount": "Float",
                "startDate": "String",
                "endDate": "String",
                "isRefunded": "Boolean",
                "refundedAt": "null|String",
                "refundedAmount": "Float"
            }
        },
        "customerNote": "null|String",
        "termsAndConditions": "null|String"
    }
}
```

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Example Response</td><td style="height: 29.7969px;">:</td><td style="height: 29.7969px;">```json
{
    "status_code": 200,
    "status_message": "OK",
    "message": "subscriptionDetailsRetrievedSuccessfully",
    "is_data": true,
    "data": {
        "subscriptionUuid": "SUB1087613902",
        "status": "ONGOING",
        "subscriptionSummary": {
            "subscriptionAmount": 100,
            "amountPaid": 2600,
            "amountRefunded": 0,
            "amountInBank": 2600,
            "startDate": "10.09.2023",
            "endDate": "09.03.2023",
            "dueDateForPaymentLink": "07:13, 12.09.2023",
            "payablePerCycle": 100,
            "frequency": "monthly",
            "repeats": 30,
            "currency": "NOK",
            "currentCycle": "Cycle 26",
            "isPaid": true,
            "isRefundable": true
        },
        "productList": [
            {
                "id": 1035,
                "productName": "Test Service",
                "productId": "S001",
                "quantity": 1,
                "rate": 100,
                "discount": 0,
                "tax": 0,
                "amount": 100
            }
        ],
        "sendOrderBy": {
            "sms": false,
            "email": true
        },
        "customerDetails": {
            "customerUuid": "CSRT3798554634",
            "customerName": "Kari Nordmann",
            "customerEmail": "test@yopmail.com",
            "countryCode": "+47",
            "msisdn": "4656746822",
            "preferredLanguage": "no",
            "address": {
                "street": "Luramyrveien 65",
                "zip": "4313",
                "city": "Sandnes",
                "country": "Norway"
            }
        },
        "organizationDetails": {
            "name": "Front Payment AS",
            "billingAddress": {
                "countryCode": "+47",
                "msisdn": "98098405",
                "email": "test@yopmail.com",
                "street": "Luramyrveien 65",
                "zip": "4313",
                "city": "Sandnes ",
                "country": "Norway"
            }
        },
        "subscriptionCycles": {
            "Cycle 1": {
                "reference": "ODR434476639",
                "status": "PAID",
                "invoiced": false,
                "amount": 100,
                "startDate": "10.09.2023",
                "endDate": "09.10.2023",
                "isRefunded": false,
                "refundedAt": null,
                "refundedAmount": 0
            },
            "Cycle 2": {
                "reference": "ODR3759688884",
                "status": "PAID",
                "invoiced": false,
                "amount": 100,
                "startDate": "01.11.2023",
                "endDate": "30.11.2023",
                "isRefunded": false,
                "refundedAt": null,
                "refundedAmount": 0
            },
            "Cycle 3": {
                "reference": "ODR2701395834",
                "status": "PAID",
                "invoiced": false,
                "amount": 100,
                "startDate": "01.11.2023",
                "endDate": "30.11.2023",
                "isRefunded": false,
                "refundedAt": null,
                "refundedAmount": 0
            },
            "Cycle 4": {
                "reference": "ODR608898249",
                "status": "PAID",
                "invoiced": false,
                "amount": 100,
                "startDate": "01.11.2023",
                "endDate": "30.11.2023",
                "isRefunded": false,
                "refundedAt": null,
                "refundedAmount": 0
            }
        },
        "customerNote": null,
        "termsAndConditions": null
    }
}
```

  
</td></tr></tbody></table>

# Get Failed Payment Details

**Description:**  
Retrieves a failed subscription order by orderUuid. The response includes details of the failed subscription order.

**Url Parameter Parameters:**

- `orderUuid` (string, required)

**Authentication**

This endpoint requires authentication using a **Bearer Token**. The client must send the token in the `Authorization` header for every request.

**Example Authentication Header:**

<div class="contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950" id="bkmrk-authorization%3A-beare"><div class="overflow-y-auto p-4" dir="ltr">`<span class="hljs-section">Authorization: Bearer YOUR_ACCESS_TOKEN</span>`</div></div>If the token is missing or invalid, the API will return a `401 Unauthorized` response.

<table border="1" id="bkmrk-endpoint-%3A-https%3A%2F%2Fd" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 21.508%;"></col><col style="width: 2.98189%;"></col><col style="width: 75.5101%;"></col></colgroup><tbody><tr><td>**Endpoint**</td><td>**:**</td><td>[<span class="resolvedVariable" data-testid="resolvedVariable" spellcheck="false"><span data-offset-key="9i8o9-0-0"><span data-text="true">https://demo-api.frontpayment.no/api/v1/connect</span></span></span>/subscriptions/failed/details/](https://demo-api.frontpayment.no/api/v1/connect/subscriptions/details/){orderUuid}</td></tr><tr><td>**Method**</td><td>**:**</td><td>GET</td></tr><tr><td>**Authorization**</td><td>**:**</td><td>Bearer</td></tr><tr><td>**Payload Validation**</td><td>**:**</td><td>  
</td></tr><tr><td>**Response Structure**</td><td>**:**</td><td>```json
{
  "status_code": "Integer",
  "status_message": "String",
  "message": "String",
  "is_data": "Boolean",
  "data": {
    "subscriptionUuid": "String",
    "orderDate": "String",
    "customerNotes": "String",
    "isInvoiced": "Boolean",
    "termsAndConditions": "String| null",
    "customerName": "string",
    "countryCode": "String",
    "msisdn": "String",
    "email": "String",
    "street": "String",
    "zip": "String",
    "city": "String",
    "country": "String",
    "subTotal": "Float",
    "totalDiscount": "Float",
    "totalTax": "Float",
    "currency": "String",
    "status": "String",
    "products": [
      {
        "productName": "String",
        "quantity": "Integer",
        "rate": "Float",
        "discount": "Float",
        "tax": "Float",
        "amount": "Float"
      }
    ]
  }
}
```

  
</td></tr><tr><td>**Example Response**</td><td>:</td><td>```json
{
  "status_code": 200,
  "status_message": "OK",
  "message": "orderRetrievedSuccessfully",
  "is_data": true,
  "data": {
    "subscriptionUuid": "SUB2532543787",
    "orderDate": "19.12.2024",
    "customerNotes": null,
    "isInvoiced": 1,
    "termsAndConditions": null,
    "customerName": "Nafees",
    "countryCode": "+47",
    "msisdn": "46567468",
    "email": "nafees@yopmail.com",
    "street": "Lura",
    "zip": "4131",
    "city": "Stavanger",
    "country": "NO",
    "subTotal": 2173.91,
    "totalDiscount": 0,
    "totalTax": 326.09,
    "currency": "NOK",
    "status": "INVOICED",
    "products": [
      {
        "productName": "Health Check Service 3",
        "quantity": 1,
        "rate": 2500,
        "discount": 0,
        "tax": 15,
        "amount": 2500
      }
    ]
  }
}
```

</td></tr></tbody></table>

# Resend Subscription

**Description:**  
Resend subscription payment link.

**Url Parameter Parameters:**

- `subscriptionUuid` (string, required) – Resend the subscription order.

<table border="1" id="bkmrk-endpoint-%3A-https%3A%2F%2Fd" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 23.6094%;"></col><col style="width: 2.48516%;"></col><col style="width: 73.9054%;"></col></colgroup><tbody><tr><td>**Endpoint**</td><td>**:**</td><td>[https://demo-api.frontpayment.no/api/v1/connect/subscriptions/resend/](https://demo-api.frontpayment.no/api/v1/connect/subscriptions/list/){subscriptionUuid}</td></tr><tr><td>**Method**</td><td>**:**</td><td>POST</td></tr><tr><td>**Request Payload**</td><td>**:**</td><td>```json
{
  "orderUuid": "String",
  "countryCode": "String",
  "msisdn": "String",
  "email": "String"
}
```

</td></tr><tr><td>**Response Structure**</td><td>**:**</td><td>```json
{
    "status_code": 202,
    "status_message": "OK",
    "message": "subscriptionOrderResentSuccessfully",
    "is_data": false,
    "data": "Array"
}
```

  
</td></tr><tr><td>**Response Example**</td><td>**:**</td><td> ```json
{
    "status_code": 202,
    "status_message": "OK",
    "message": "subscriptionOrderResentSuccessfully",
    "is_data": false,
    "data": null
}
```

</td></tr></tbody></table>

# Cancel Subscription

**Description**

Cancel a subscription by uuid. Only SEND and ONGOING subscription can be cancelled

<table border="1" id="bkmrk-endpoint-%3A-https%3A%2F%2Fd" style="border-collapse: collapse; width: 100%; height: 178.781px;"><colgroup><col style="width: 22.1261%;"></col><col style="width: 2.73345%;"></col><col style="width: 75.1405%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Endpoint**</td><td style="height: 29.7969px;">**:**</td><td style="height: 29.7969px;">[https://demo-api.frontpayment.no/api/v1/connect/subscriptions/cancel/](https://demo-api.frontpayment.no/api/v1/connect/subscriptions/list/){subscriptionUuid}</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Method**</td><td style="height: 29.7969px;">**:**</td><td style="height: 29.7969px;">POST</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Authorization**</td><td style="height: 29.7969px;">**:**</td><td style="height: 29.7969px;">Bearer</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Request Payload**</td><td style="height: 29.7969px;">**:**</td><td style="height: 29.7969px;">```json
{
    "note": "String"
}
```

  
</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Response Structure**</td><td style="height: 29.7969px;">**:**</td><td style="height: 29.7969px;"> ```json
{
    "status_code": 201,
    "status_message": "OK",
    "message": "successfullyCancelledSubscription",
    "is_data": true,
    "data": "Array"
}
```

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Example Response**</td><td style="height: 29.7969px;">**:**</td><td style="height: 29.7969px;">```json
{
    "status_code": 201,
    "status_message": "OK",
    "message": "successfullyCancelledSubscription",
    "is_data": true,
    "data": []
}
```

```json
{
    "status_code": 400,
    "status_message": "Conflict of Business Logic ",
    "message": "cannotCancelSubscription",
    "is_error": true,
    "errors": []
}
```

</td></tr></tbody></table>

# Refund Subscription Cycle

**Description:**  
Refund a specific order or cycle of a subscription

**Url Parameter Parameters:**

- subscriptionUuid (string, required) – Uuid Of Subscription

**Authentication**

This endpoint requires authentication using a **Bearer Token**. The client must send the token in the `Authorization` header for every request.

**Example Authentication Header:**

<div class="contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950" id="bkmrk-authorization%3A-beare"><div class="overflow-y-auto p-4" dir="ltr">`<span class="hljs-section">Authorization: Bearer YOUR_ACCESS_TOKEN</span>`</div></div>If the token is missing or invalid, the API will return a `401 Unauthorized` response.

<table border="1" id="bkmrk-endpoint-%3A-https%3A%2F%2Fd" style="border-collapse: collapse; width: 100%; height: 237.75px;"><colgroup><col style="width: 21.3844%;"></col><col style="width: 1.97775%;"></col><col style="width: 76.6378%;"></col></colgroup><tbody><tr style="height: 35.3906px;"><td style="height: 35.3906px;">**Endpoint**</td><td style="height: 35.3906px;">**:**</td><td style="height: 35.3906px;">[https://demo-api.frontpayment.no/api/v1/connect/subscriptions/cycles/refund/](https://demo-api.frontpayment.no/api/v1/connect/subscriptions/list/){subscriptionUuid}</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Method**</td><td style="height: 29.7969px;">**:**</td><td style="height: 29.7969px;">POST</td></tr><tr><td>**Authorization**</td><td>  
</td><td>Bearer</td></tr><tr style="height: 83.172px;"><td style="height: 83.172px;">**Request Payload**</td><td style="height: 83.172px;">**:**</td><td style="height: 83.172px;">```php
'cycles' => 'required|array',
'amount' => 'required|numeric',
```

  
</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Response Structure**</td><td style="height: 29.7969px;">**:**</td><td style="height: 29.7969px;">```json
{
    "status_code": "Integer",
    "status_message": "String",
    "message": "String",
    "is_data": "Boolean",
    "data": "Array",
    "is_error": "Boolean",
    "errors": "Array"
}
```

  
</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Example Response**</td><td style="height: 29.7969px;">**:**</td><td style="height: 29.7969px;">```json
{
    "status_code": 201,
    "status_message": "OK",
    "message": "refundProcessedSuccessfully",
    "is_data": true,
    "data": []
}
```

```json
{
    "status_code": 404,
    "status_message": "Execution Exception Occurred",
    "message": "cycleNotfound#cycle1",
    "is_data": false,
    "is_error": true,
    "errors": []
}
```

```json
{
    "status_code": 400,
    "status_message": "Execution Exception Occurred",
    "message": "someCyclesFailedToPassValidation",
    "is_data": false,
    "is_error": true,
    "errors": []
}
```

```json
{
    "status_code": 510,
    "status_message": "Execution Exception Occurred",
    "message": "somethingWentWrong",
    "is_data": false,
    "is_error": true,
    "errors": []
}
```

</td></tr></tbody></table>