Stykite
  1. Subscription
Stykite
  • Introduction
  • Pre-requisites: Account & API Keys
  • Integration
    • Self-Serve Integration on your SaaS/AI App
    • Usage-Based Billing
    • Customer Facing Widgets
      • Pricing Widget Integration Guide
      • My Account Widget Integration
      • Subscribe Button
    • API Reference
      • Webhooks
        • Customer Subscription Status Update
        • Add-on Purchase Success
      • Usage
        • Send Usage
      • Customer
        • Create Customer with Auto Subscribe
        • Get Customer and Subscription Details
      • Subscription
        • Cancel Subscription
          POST
        • Update Subscription
          PUT
  • Learning Stykite
    • Subscriptions & Plans
    • Add-ons
    • Pricing Versions
    • Manual Subscriptions & Exclusive Plans
    • Invoices
    • Payments
    • Sales Tax
    • Customers
    • Transactions & Refunds
    • Settings
  1. Subscription

Update Subscription

Developing
PUT
/v1/company/{companyId}/country/{countryId}/customer/{customerIdentifier}/subscription

Update Subscription End Date API#

This API allows updating a customer's subscription end date.

Endpoint#

PUT https://api.stykite.com/v1/company/:companyId/country/:countryId/customer/:customerIdentifier/subscription

Description#

This API endpoint updates the end date of a customer's subscription.

Request Parameters#

Path Parameters#

companyId (string, required): The unique identifier of the company.
countryId (string, required): The unique identifier of the country.
customerIdentifier (string, required): The unique identifier of the customer.

Headers#

Authorization (string, required): The authorization token in the format Bearer <token>.
Content-Type (string, required): Must be set to application/json.

Body Parameters#

subscription_tsid (string, required): The unique identifier of the subscription.
end_date (number, required): The timestamp (in milliseconds) representing the new end date for the subscription.

Example Request#

Response#

201 Accepted: Subscription end date updated successfully.
400 Bad Request: Invalid parameters.
401 Unauthorized: Missing or invalid authorization token.
404 Not Found: Subscription or customer not found.
500 Internal Server Error: Unexpected server error.

Notes#

Ensure the Authorization header contains a valid bearer token.
Double-check that the subscription_tsid is correct and belongs to the specified customer.
The end_date must be a valid timestamp.
For further assistance, contact Stykite support.

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Path Params
companyId
string 
required
countryId
string 
required
customerIdentifier
string 
required
Header Params
Authorization
string 
required
Example:
Bearer Yfu81W8CNmhRleRFaqoZpikiKIU009jwQ5wRv97TDLY
Content-Type
string 
required
Example:
application/json
Body Params application/json
subscription_tsid
string 
required
end_date
integer 
required
Example
{
    "subscription_tsid" : "SUA-0K6FC7CCNBBQD",
    "end_date" : 1742797511000
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request PUT 'https://sandbox.api.stykite.com/v1/company//country//customer//subscription' \
--header 'Authorization: Bearer Yfu81W8CNmhRleRFaqoZpikiKIU009jwQ5wRv97TDLY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "subscription_tsid" : "SUA-0K6FC7CCNBBQD",
    "end_date" : 1742797511000
}'

Responses

🟢200Success
application/json
Body
object {0}
Example
{}
Modified at 2025-03-24 06:36:43
Previous
Cancel Subscription
Next
Subscriptions & Plans
Built with