/change_renewal_date

/subscription/change_renewal_date

Target audience: Developers

Introduction

This endpoint lets you change renewal date on a user product.

URI

Environment URI
Stage https://payway-api.stage.adeprimo.se/external/api/v1/subscription/change_renewal_date
Production https://backend.worldoftulo.com/external/api/v1/subscription/change_renewal_date

Requirements

Identity Scope
No /external/subscription/w

Parameters

Name Type Required Description
user_product_id String Required The id of the user product to update
add_days String Optional Number of days to add (positive number)
remove_days String Optional Number of days to remove (positive number)
valid_to_date String Optional Specific date, format YYYY-MM-DD
requested_by String Optional Default: 'external_api'

Curl Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
curl --request PUT \
  --url https://payway-api.stage.adeprimo.se/external/api/v1/subscription/change_renewal_date \
  --header 'accept: application/json' \
  --header 'authorization: Bearer token' \
  --header 'content-type: application/json' \
  --data '{
    "user_product_id": "50f3ac249f6aef294d000007",
    "valid_to_date": "2020-04-01",
    "requested_by": "Payway Admin"
  }'

Response

Field Description
id id of the user_product
new_valid_to The new expiration date

Example Response

1
2
3
4
5
HTTP 200
{
    "id": "50f3ac249f6aef294d000007",
    "new_valid_to": "2020-04-01T08:36:08+02:00"
}

Errors

Bad request

1
2
3
4
5
6
HTTP 400 Bad request
{
  "code": "invalid_parameter",
  "field": "add_days",
  "message": "Must be a positive number"
}

Invalid parameter

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
HTTP 409 Conflict
{
  "code": "invalid_parameter",
  "field": [
    "add_days",
    "remove_days",
    "valid_to_date"
  ],
  "message": "One of parameters [add_days, remove_days, valid_to_date] is required"
}

Not found

This will occur if no active package downgrade request exists for the user_product.

1
2
3
4
5
6
HTTP 409 Conflict
{
  "code": "does_not_exist",
  "field": "unspecified_field",
  "message": "id_of_user_product"
}

HTTP 500 Internal Server Error

Name Type Description
internal_server_error Object Something unexpected happened server side