Skip to main content
PATCH
/
subscriptions
Update a subscription
curl --request PATCH \
  --url https://sandbox-api.paynext.com/subscriptions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "plan": {
    "id": "price_63e6b401-3803-4f95-aae9-262a0490dafd"
  },
  "subscription": {
    "id": "sub_887934f2-de1a-4b28-a288-ba8f70c71bd3",
    "status": "<unknown>"
  }
}
'
{
  "id": "sub_123e4567-e89b-12d3-a456-426614174000",
  "current_period_end": "<string>",
  "current_period_start": "<string>",
  "next_billing_date": "2025-06-26T12:00:00Z",
  "past_due": {
    "attempt_count": 2,
    "max_attempts_count": 7
  },
  "plan": {
    "id": "price_1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
    "archived_at": "2025-06-01T10:00:00Z",
    "interval": "days",
    "interval_count": 1,
    "name": "Pro Plan",
    "price": {
      "amount": 1999,
      "currency": "AED"
    },
    "tax": {
      "collect_tax": "<unknown>"
    },
    "trial_interval": "days",
    "trial_interval_count": 14,
    "trial_price": {
      "amount": 1999,
      "currency": "AED"
    },
    "type": "recurring"
  },
  "metadata": {
    "key": "value"
  },
  "created_at": "2025-05-26T10:00:00Z",
  "updated_at": "2025-05-27T10:00:00Z"
}

Authorizations

Authorization
string
header
required

Authentication header of the form api key, where api key is your organization api key.

Headers

X-API-Version
enum<string>

Specifies the version of the API to use

Available options:
2.0.0

Body

application/json

Update subscription

plan
object

New plan details to be applied

subscription
object

Subscription to be updated

Response

Returns the updated subscription object.

id
string

Unique identifier for the subscription

Example:

"sub_123e4567-e89b-12d3-a456-426614174000"

current_period_end
string
current_period_start
string
next_billing_date
string

Next scheduled billing date for the subscription

Example:

"2025-06-26T12:00:00Z"

past_due
object

Information about past due attempts

plan
object
status
enum<string>

Current status of the subscription

Available options:
trial,
active,
past_due,
cancelled,
scheduled_for_cancellation
metadata
object

Custom metadata associated with the subscription A dictionary of key-value pairs.

Example:
{ "key": "value" }
created_at
string

The date and time at which the subscription was created in UTC format

Example:

"2025-05-26T10:00:00Z"

updated_at
string

The date and time of the last subscription update in UTC format

Example:

"2025-05-27T10:00:00Z"