# Partner Checkout

Partner endpoints for checkout flows — initiate, update, and validate checkout baskets within the partner organisation context.

## Create Partner Checkout Session

> Create or update a checkout basket using partner credentials. Uses the same checkout flow as the public endpoint but authenticated via partner token. The basket is associated with the partner organisation context.

```json
{"openapi":"3.1.0","info":{"title":"Limio Commerce API","version":"1.0.0"},"tags":[{"name":"Partner Checkout","description":"Partner endpoints for checkout flows — initiate, update, and validate checkout baskets within the partner organisation 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":["partner"]}],"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>`"}},"schemas":{"InitiateCheckout":{"type":"object","title":"Initiate Checkout","description":"Create a new basket","allOf":[{"type":"object","properties":{"order":{"type":"object","properties":{"orderItems":{"type":"array","items":{"type":"object","properties":{"offer":{"$ref":"#/components/schemas/OfferPayload"},"quantity":{"type":"number"},"type":{"type":"string","description":"Item type. Only required when the basket includes add-ons alongside offers — set to \"offer\" for the main offer and \"add_on\" for each add-on. Can be omitted for offer-only baskets.","enum":["offer","add_on"]}}}},"external_id":{"type":"string","description":"external order reference - becomes the checkoutId of the order"},"tracking":{"$ref":"#/components/schemas/Tracking"},"country":{"type":"string","description":"the country code of the customer's purchase location"},"source":{"type":"string","description":"source of the order"},"order_type":{"type":"string","enum":["new","renew"]}},"required":["orderItems","external_id","country","source","order_type"]}},"required":["order"]}]},"OfferPayload":{"description":"Reference to a published Limio offer.\nRetrieve `id` and `version` from `GET /offers/v2`.\n","required":["id","version"],"properties":{"id":{"type":"string","description":"The unique content hash of the offer. Retrieve from `GET /offers/v2`."},"version":{"type":"string","description":"The version hash of the offer. Use the latest version from the same API response."}}},"Tracking":{"type":"object","description":"Tracking data associated with the order, used for attribution and integration with external systems. When `accountId` is provided, the basket is assigned an owner and the response includes an `assistedCheckoutLink` for OBO (On-Behalf-Of) checkout flows.","properties":{"offers":{"type":"array","items":{"type":"string"}},"purchaseCountryCode":{"type":"string"},"accountId":{"type":"string","description":"Salesforce Account ID. When provided, Limio resolves or creates an identity owner for the basket and returns an `assistedCheckoutLink` in the response."},"contactId":{"type":"string","description":"Salesforce Contact ID associated with this order."},"userId":{"type":"string","description":"Salesforce User ID associated with this order."}}}},"responses":{"401Response":{"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":{"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":{"/partner/checkout/initiate":{"post":{"operationId":"partnerInitiateCheckout","summary":"Create Partner Checkout Session","tags":["Partner Checkout"],"description":"Create or update a checkout basket using partner credentials. Uses the same checkout flow as the public endpoint but authenticated via partner token. The basket is associated with the partner organisation context.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InitiateCheckout"}}}},"responses":{"200":{"description":"Basket created or updated successfully.","content":{"application/json":{"schema":{"type":"object","required":["id","order"],"properties":{"id":{"type":"string","description":"The unique ID of the created or updated basket."},"order":{"type":"object","properties":{"orderItems":{"type":"array","items":{"type":"object"}}}}}}}}},"401":{"$ref":"#/components/responses/401Response"},"502":{"$ref":"#/components/responses/502Response"}}}}}}
```

## Update Partner Checkout Basket

> Update an existing partner checkout basket with order item actions — add items, remove items, or change quantities. Uses partner authentication.

```json
{"openapi":"3.1.0","info":{"title":"Limio Commerce API","version":"1.0.0"},"tags":[{"name":"Partner Checkout","description":"Partner endpoints for checkout flows — initiate, update, and validate checkout baskets within the partner organisation 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":["partner"]}],"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":{"401Response":{"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":{"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":{"/partner/checkout/update":{"put":{"operationId":"partnerUpdateCheckout","summary":"Update Partner Checkout Basket","tags":["Partner Checkout"],"description":"Update an existing partner checkout basket with order item actions — add items, remove items, or change quantities. Uses partner authentication.","parameters":[{"name":"Cookie","in":"header","required":true,"schema":{"type":"string"},"description":"Landing state cookie containing the basketId."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderActions"],"properties":{"orderActions":{"type":"array","description":"List of actions to apply to the basket.","items":{"type":"object","required":["orderItemActionType"],"properties":{"orderItemActionType":{"type":"string","enum":["add","remove","change_quantity"]},"offerId":{"type":"string"},"orderItemId":{"type":"string"},"quantity":{"type":"integer"}}}}}}}}},"responses":{"200":{"description":"Basket updated successfully.","content":{"application/json":{"schema":{"type":"object","required":["id","order","orderActionResults"],"properties":{"id":{"type":"string"},"order":{"type":"object"},"orderActionResults":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"actionType":{"type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/401Response"},"404":{"description":"Basket not found."},"502":{"$ref":"#/components/responses/502Response"}}}}}}
```

## Validate Partner Checkout

> Validate a partner checkout basket before order submission. Checks product availability, pricing validity, and returns any blocked products or validation errors.

```json
{"openapi":"3.1.0","info":{"title":"Limio Commerce API","version":"1.0.0"},"tags":[{"name":"Partner Checkout","description":"Partner endpoints for checkout flows — initiate, update, and validate checkout baskets within the partner organisation 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":["partner"]}],"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":{"401Response":{"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":{"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":{"/partner/checkout/validate/{id}":{"post":{"operationId":"partnerValidateCheckout","summary":"Validate Partner Checkout","tags":["Partner Checkout"],"description":"Validate a partner checkout basket before order submission. Checks product availability, pricing validity, and returns any blocked products or validation errors.","parameters":[{"name":"id","in":"path","required":true,"description":"The basket ID to validate (format `basket-{uuid}`).","schema":{"type":"string","pattern":"^basket-[A-Za-z0-9\\-_]{32,36}$"}}],"responses":{"200":{"description":"Validation result returned.","content":{"application/json":{"schema":{"type":"object","required":["id","checkout","invalid"],"properties":{"id":{"type":"string","description":"The basket ID."},"checkout":{"type":"object","description":"The current basket state."},"invalid":{"type":"object","description":"Validation issues found.","properties":{"blockedProducts":{"type":"array","description":"Products that are blocked or unavailable.","items":{"type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/401Response"},"404":{"description":"Basket not found."},"502":{"$ref":"#/components/responses/502Response"}}}}}}
```
