> For the complete documentation index, see [llms.txt](https://docs.limio.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.limio.com/api/checkout-baskets-api/renew-subscription.md).

# Renew Subscription

Create checkout baskets to renew an existing subscription. The basket is pre-populated with the subscription's renewal context.

## Create checkout basket to renew subscription

> Create a checkout basket for renewing an existing subscription. Looks up the subscription by its external reference, verifies the supplied customer details against it, and creates a basket pre-populated with the renewal context.

```json
{"openapi":"3.1.0","info":{"title":"Limio Commerce API","version":"1.0.0"},"tags":[{"name":"Renew Subscription","description":"Create checkout baskets to renew an existing subscription. The basket is pre-populated with the subscription's renewal context."}],"servers":[{"url":"https://{tenant}/api","description":"Limio environment API","variables":{"tenant":{"default":"your-environment.prod.limio.com","description":"Your Limio environment hostname, e.g. `acme.prod.limio.com` or `acme-sandbox.prod.limio.com`."}}}],"security":[{"bearerAuth":["admin"]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2.0 Bearer token for authenticated API access. Required for order submission, object management, and administrative operations.\n\nObtain a token via the OAuth flow described in [OAuth Bearer Token](https://docs.limio.com/developers/api-documentation/authentication-overview/oauth-bearer-token).\n\nPass the token in the `Authorization` header: `Bearer <token>`"}},"responses":{"401ApplicationResponse":{"description":"Unauthorized: the request lacks valid authentication credentials. Verify your Bearer token or API key is correct and has not expired.","content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string","description":"The unique identifier of the request"},"code":{"type":"string"},"message":{"type":"string"}}}}}},"502Response":{"description":"Bad Gateway — an upstream service returned an unexpected response. This typically indicates an issue with the request payload (e.g. invalid field values, missing required fields) or a transient infrastructure error. Retry the request, and if the issue persists, verify the request body matches the expected schema.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable error description."}}}}}}}},"paths":{"/admin/checkout/initiate/renew":{"post":{"operationId":"admin_initiateRenewCheckout","summary":"Create checkout basket to renew subscription","tags":["Renew Subscription"],"description":"Create a checkout basket for renewing an existing subscription. Looks up the subscription by its external reference, verifies the supplied customer details against it, and creates a basket pre-populated with the renewal context.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["subscriptionReference","verify"],"properties":{"subscriptionReference":{"type":"string","description":"The external reference of the subscription to renew. The lookup is by reference only; Limio subscription IDs are not accepted."},"external_id":{"type":"string","maxLength":128,"pattern":"^[0-9a-zA-Z-_]+$","description":"External order reference."},"verify":{"type":"object","description":"Customer details to verify against the subscription. Must not be empty. Supply `customerDetails`, `address`, or both. Every `customerDetails` field you supply must match the subscription's stored customer record; an `address` matches when any one of the subscription's addresses matches (case-insensitive).","properties":{"customerDetails":{"type":"object","properties":{"hashedEmail":{"type":"string","description":"SHA-256 hash (lowercase hex) of the customer's email address. A plain email address is not accepted; compute the hash before sending."},"firstName":{"type":"string"},"lastName":{"type":"string"}}},"address":{"type":"object","properties":{"postalCode":{"type":"string"}}}}}}}}}},"responses":{"200":{"description":"Renewal checkout basket created successfully.","content":{"application/json":{"schema":{"type":"object","required":["id","order"],"properties":{"id":{"type":"string","description":"The unique ID of the created renewal basket."},"segments":{"description":"Customer segments applicable to the renewal. When a Salesforce contact is found for the subscription this is a JSON-encoded string containing an array of SHA-1 hashed segment paths; when no contact is found it is an empty array.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"order":{"type":"object","description":"The pre-populated renewal order details.","properties":{"external_id":{"type":"string"},"order_type":{"type":"string"},"subId":{"type":"string"},"subRef":{"type":"string"},"customerDetails":{"type":"object","properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"}}},"country":{"type":"string"},"renewalDetails":{"type":"object","description":"Details of the subscription being renewed.","properties":{"subscription":{"type":"object"},"attributes":{"type":"object"}}},"tracking":{"type":"object"},"hideEmailField":{"type":"boolean"},"hidePriceField":{"type":"boolean"}}}}}}}},"401":{"$ref":"#/components/responses/401ApplicationResponse"},"500":{"description":"Application error. Returned when the subscription cannot be found for the supplied reference, or when verification of the supplied customer details fails.","content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string","description":"The unique identifier of the request"},"code":{"type":"string"},"message":{"type":"string"}}}}}},"502":{"$ref":"#/components/responses/502Response"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.limio.com/api/checkout-baskets-api/renew-subscription.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
