Looking for ePay classic docs? Go to docs.epay.dk
ePay documentationDocsePay documentation
Subscriptions

Update Subscription

Test this endpoint live

Open the same request directly in API Explorer.

Open in API Explorer

Server URL

PATCH
/public/api/v1/subscriptions/{subscriptionId}

Updates the meta data of an ACTIVE subscription. This can be used to update the price or interval of in-app payment methods such as Vipps MobilePay.

Authorization

BearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

subscriptionIdstring
Required

The id of the subscription to update.

Format:
uuid

Header Parameters

Idempotency-Keystring

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

amountinteger
Required

The subscription charge amount in minor units (e.g., 1095 = 10.95 DKK). This is displayed in-app for payment methods such as Vipps MobilePay.

Range:
1 <= value
Example:
9900
typestring
Required

The type of the subscription

Possible values:
"SCHEDULED""UNSCHEDULED"
Example:
"SCHEDULED"
expiryDatestring
NullableRequired

The expiry date of the subscription. Do note that ePay does not enforce this expiration date, but it is used during processing of transactions.

Format:
date
Example:
"2035-07-23"

An optional subscription schedule for SCHEDULED type subscriptions. Must be omitted for UNSCHEDULED type subscriptions. Is required by some payment methods such as Vipps Mobilepay.

periodstring
Required
Possible values:
"DAY""WEEK""MONTH""YEAR"
Example:
"MONTH"
frequencyinteger
Required
Range:
1 <= value <= 31
Example:
1

Response Body

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/public/api/v1/subscriptions/497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "Idempotency-Key: c4f5e8d2-1234-5678-90ab-cdef12345678" \  -H "Content-Type: application/json" \  -d '{    "amount": 9900,    "type": "SCHEDULED",    "expiryDate": "2035-07-23"  }'
{  "subscription": {    "id": "01929a94-5fce-7ccc-a7e4-7e9249133b39",    "paymentMethodId": "01924756-d1f6-738d-8040-90d76cedf01f",    "currency": "DKK",    "customerId": "User159",    "pointOfSaleId": "0192473a-e381-705c-b61c-fc2ac9624afc",    "reference": "reference-1",    "description": "string",    "state": "ACTIVE",    "type": "SCHEDULED",    "expiryDate": "2050-01-01",    "interval": {      "period": "MONTH",      "frequency": 1    },    "createdAt": "2019-08-24T14:15:22Z"  },  "paymentMethod": {    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",    "type": "CARD",    "subType": "Visa",    "customerId": "User159",    "expiry": "2024-07-29",    "createdAt": "2024-07-29T15:51:28.071Z",    "displayText": "40000000XXXX0003"  }}
{  "errorCode": "SERVER_ERROR",  "message": "An unexpected system error"}
{  "errorCode": "VALIDATION_ERROR",  "message": "Input validation errors",  "errors": {    "amount": [      "[required]: Is a required non-nullable field",      "[int]: Must be an integer",      "[min:0]: Must be greater than 0",      "[max:999999999]: Must be less than 999999999"    ]  }}
{  "errorCode": "SERVER_ERROR",  "message": "An unexpected system error"}