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>"
  }
}
'
{
  "created_at": "2025-05-26T10:00:00Z",
  "current_period_end": "<string>",
  "current_period_start": "<string>",
  "id": "sub_123e4567-e89b-12d3-a456-426614174000",
  "metadata": {
    "key": "value"
  },
  "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",
    "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"
  },
  "status": "trial",
  "updated_at": "2025-05-27T10:00:00Z"
}

Documentation Index

Fetch the complete documentation index at: https://docs.paynext.com/llms.txt

Use this file to discover all available pages before exploring further.

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:
1.0.0

Body

application/json

Update subscription

plan
object

New plan details to be applied

subscription
object

Subscription to be updated

Response

OK

created_at
string

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

Example:

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

current_period_end
string
current_period_start
string
id
string

Unique identifier for the subscription

Example:

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

metadata
object

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

Example:
{ "key": "value" }
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
updated_at
string

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

Example:

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