# Replace card segment and benefits Replaces the segment and existing benefits with a new benefit set assigned via a new segment code. The existing benefits are cancelled, and new benefits are assigned. An array of newly-assigned bundles is returned in the response. This endpoint generates a [Cards benefits allocation updated](https://developers.pismo.io/events/docs/cards-benefits-allocation-1) event. **Note:** This is a PCI endpoint, use the https://gw-pci.pismolabs.io environment. # OpenAPI definition ```json { "openapi": "3.0.1", "info": { "title": "Card issuing - Cards", "version": "1.4.6", "description": "Card endpoints API", "contact": { "name": "API Support", "url": "https://developers.pismo.io/support/" }, "license": { "name": "Copyright Pismo" } }, "servers": [ { "url": "https://sandbox.pismolabs.io", "description": "Sandbox API server for testing." }, { "url": "https://gw-pci.pismolabs.io", "description": "Sandbox PCI API server for testing" } ], "security": [ { "BearerAuth": [] } ], "tags": [ { "name": "Mastercard benefits", "description": "Card benefits endpoints" } ], "components": { "schemas": { "Bundle": { "type": "object", "description": "Bundle object. A Mastercard card segment **bundle** is a targeted package of benefits, rewards, or services assigned to specific carholder groups based on need.\n", "properties": { "code": { "$ref": "#/components/schemas/Code" }, "effective_date": { "$ref": "#/components/schemas/EffectiveDate" }, "expiry_date": { "$ref": "#/components/schemas/ExpiryDate" } } }, "Bundles": { "type": "array", "description": "Bundle object array", "items": { "$ref": "#/components/schemas/Bundle" } }, "BundlesResponse": { "type": "object", "description": "Bundle response object. A Mastercard card segment **bundle** is a targeted package of benefits, rewards, or services assigned to specific carholder groups based on need.", "properties": { "bundles": { "$ref": "#/components/schemas/Bundles" }, "network_correlation_id": { "$ref": "#/components/schemas/NetworkCorrelationId" } } }, "CardID2": { "type": "integer", "description": "Pismo card ID", "example": 123456 }, "Code": { "type": "string", "description": "Code", "example": "LAC_BBC" }, "EffectiveDate": { "type": "string", "description": "Card effective date. Format = yyyy-mm-dd", "example": "2025-07-31" }, "ExpiryDate": { "type": "string", "description": "Card expiration date. Format = yyyy-dd-mm", "example": "2026-01-20" }, "NetworkCorrelationId": { "type": "string", "description": "Network correlation ID", "example": "fe1bf855f651810629107cfbce5b09d2" }, "ReplaceBenefit": { "type": "object", "required": [ "card_id", "old_segment_code", "new_segment_code", "effective_date" ], "properties": { "card_id": { "$ref": "#/components/schemas/CardID2" }, "old_segment_code": { "$ref": "#/components/schemas/ReplaceOldCode" }, "new_segment_code": { "$ref": "#/components/schemas/ReplaceNewCode" }, "effective_date": { "$ref": "#/components/schemas/EffectiveDate" } } }, "ReplaceNewCode": { "type": "string", "description": "New segment code", "example": "LAC_BBD" }, "ReplaceOldCode": { "type": "string", "description": "Old segment code", "example": "LAC_BBC" } }, "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "description": "Account token - an access token encoded with a Pismo account ID. Tokens can expire quickly, which can result in an \"Unauthorized\" error.", "bearerFormat": "JWT" } }, "responses": { "400BadRequest": { "description": "Bad Request" }, "401Unauthorized": { "description": "Access token is missing or invalid" }, "403Forbidden": { "description": "You don't have permission to access this resource" }, "500InternalServer": { "description": "Internal server error" } } }, "paths": { "/pcicards/v1/pcicards/benefits/segments/replace": { "put": { "summary": "Replace card segment and benefits", "description": "Replaces the segment and existing benefits with a new benefit set assigned via a new segment code. The existing benefits are cancelled, and new benefits are assigned. An array of newly-assigned bundles is returned in the response. \n\nThis endpoint generates a [Cards benefits allocation updated](https://developers.pismo.io/events/docs/cards-benefits-allocation-1) event.\n\n**Note:** This is a PCI endpoint, use the https://gw-pci.pismolabs.io environment.\n", "operationId": "post-v1-benefits-segments-replace", "tags": [ "Mastercard benefits" ], "requestBody": { "description": "Replace card segment and updates request body", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReplaceBenefit" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BundlesResponse" } } } }, "400": { "$ref": "#/components/responses/400BadRequest" }, "401": { "$ref": "#/components/responses/401Unauthorized" }, "403": { "$ref": "#/components/responses/403Forbidden" }, "500": { "$ref": "#/components/responses/500InternalServer" } } } } } } ```