# Replace Segment
source: https://developer.mastercard.com/benefit-allocation-service-mtls/documentation/use-cases/segment-operations/replace_segment/index.md

#### Overview {#overview}

**Actors:** Issuer developer, Mastercard Global Benefits Platform  

**Preconditions:** Card has an active segment assigned; the new segment has been pre-configured by Mastercard for the ICA; the new segment's effective date is not before the current segment's effective date  

**Outcome:** The old segment's bundles are expired the day before the effective date; the new segment's bundles are assigned from the effective date  

**Endpoint:** `PUT /card-segments-replacements` --- use this endpoint when a segment is already active and you need to change it to a different one; use [Cancel Segment](https://developer.mastercard.com/benefit-allocation-service-mtls/documentation/use-cases/segment-operations/cancel_segment/index.md) if you want to remove the segment without assigning a replacement

Replaces the existing segmented benefits with the new segmented benefits by taking a card number, old segment, new
segment and effective date in the input. In order for segment replace to succeed an assign segment must have been
successful first. The existing segmented benefits will be expired the day before the effective date, and new benefits
are assigned with the effective date. The response is an array of segmented bundles that are newly assigned to the card.
Exactly one input segment is supported at this time.
Diagram replace_segment
API Reference: `PUT /card-segments-replacements`

### Replace segment associated with a card using today's date and the card was previously assigned successfully. Most common use case. {#replace-segment-associated-with-a-card-using-todays-date-and-the-card-was-previously-assigned-successfully-most-common-use-case}

1. Cardholder requests a new segment to be associated with their card.
2. Issuer sends a request with a card number, old segment code, new segment code and effective date as an input parameter with today's date
3. Benefit Allocation Service API returns the segment benefit bundle codes assigned during replace segment with the new segment's bundles effective and expiration dates.

## Effective date scenarios {#effective-date-scenarios}

### Replace segment associated with a card using future effective date and the card was previously assigned successfully. {#replace-segment-associated-with-a-card-using-future-effective-date-and-the-card-was-previously-assigned-successfully}

1. Cardholder requests a new segment to be associated with their card.
2. Issuer sends a request with a card number, old segment code, new segment code and effective date as an input parameter with a future date
3. Benefit Allocation Service API returns the new segment benefit bundle codes assigned during replace segment with the new segment's bundles future effective and expiration dates.

### Replace segment associated with a card using a past date, but after the card's segment was previously assigned successfully. {#replace-segment-associated-with-a-card-using-a-past-date-but-after-the-cards-segment-was-previously-assigned-successfully}

1. Cardholder requests a new segment to be associated with their card.
2. Issuer sends request with card number, old segment code, new segment code and effective date as an input parameter with a past date
3. Benefit Allocation Service API returns the new segment benefit bundle codes assigned during replace segment with the new segment's bundles past effective and expiration dates.

### Replace segment code that has a bundle with a future expiry date {#replace-segment-code-that-has-a-bundle-with-a-future-expiry-date}

1. Cardholder requests a new benefit be associated with their card.
2. Issuer sends request with card number, old segment code, new segment code and effective date as an input parameter
3. Benefit Allocation Service API returns the segment benefit bundle codes assigned during replace with effective and expiration dates, bundles with future expiration dates will get the future expiration date applied.

## Additional Information {#additional-information}

* The card segment can only be replaced with a different segment.

Tip: The following operations are allowed to be performed after Replace Segment: **Replace Segment, Replace Card, Cancel
Segment**

1. Look at the [API Reference](https://developer.mastercard.com/benefit-allocation-service-mtls/documentation/api-reference/index.md) for information on how to implement this use case.
2. Look at the [Responses Codes and Error Codes](https://developer.mastercard.com/benefit-allocation-service-mtls/documentation/code-and-formats/index.md) for acknowledgement responses.
