# Activate or cancel contract

Enable a contract to use locked in FX rates in an Account Payout. For Account Payouts customers only.

Endpoint: PUT /foreignExchange/contract/{contractId}
Version: 1
Security: basicAuth

## Security:

  - `basicAuth` (unknown)
    http basic

## Path parameters:

  - `contractId` (string, required)
    Unique ID of the contract.

## Header parameters:

  - `Accept` (string, required)

  - `WP-CorrelationId` (string)
    Optional ID to trace requests, if not provided, it is generated.

## Request fields (application/vnd.worldpay.foreignexchange-v1+json):

  - `status` (string, required)
    New status of the contract.
    Enum: "ACTIVE", "CANCELLED"

  - `entity` (string, required)
    6-digit reference given to you by your Worldpay Implementation Manager during the onboarding process
    Example: 100001

## Request examples:

  - `Activate contract` (unknown)

  - `Cancel contract` (unknown)

## Response 204:

  - `204` (unknown)
    OK response if the request is valid

## Response 400:

  - `400` (unknown)
    BAD REQUEST response if the status of the contract is not valid

## Response 400 fields (application/vnd.worldpay.foreignexchange-v1+json):

  - `errorName` (string, required)
    The unique error name

  - `message` (string, required)
    Error description message

## Response 401:

  - `401` (unknown)
    UNAUTHORIZED response if credentials are invalid

## Response 401 fields (application/vnd.worldpay.foreignexchange-v1+json):

  - `errorName` (string, required)
    The unique error name

  - `message` (string, required)
    Error description message

## Response 403:

  - `403` (unknown)
    FORBIDDEN response if Entitlements are not valid

## Response 403 fields (application/vnd.worldpay.foreignexchange-v1+json):

  - `errorName` (string, required)
    The unique error name

  - `message` (string, required)
    Error description message

## Response 404:

  - `404` (unknown)
    NOT FOUND response

## Response 404 fields (application/vnd.worldpay.foreignexchange-v1+json):

  - `errorName` (string, required)
    The unique error name

  - `message` (string, required)
    Error description message

## Response 409:

  - `409` (unknown)
    CONFLICT response

## Response 409 fields (application/vnd.worldpay.foreignexchange-v1+json):

  - `errorName` (string, required)
    The unique error name

  - `message` (string, required)
    Error description message

## Response 500:

  - `500` (unknown)
    Internal server error

## Response 500 fields (application/vnd.worldpay.foreignexchange-v1+json):

  - `errorName` (string, required)
    The unique error name

  - `message` (string, required)
    Error description message

## Response 400 examples:

  - `status is not correct` (unknown)

## Response 401 examples:

  - `Unauthorized` (unknown)

## Response 403 examples:

  - `forbidden` (unknown)

## Response 404 examples:

  - `pageNotFound` (unknown)

## Response 409 examples:

  - `when a contract is re-activated or re-cancelled` (unknown)

