> ## Documentation Index
> Fetch the complete documentation index at: https://magic-21.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Exchange Public Token

> Initiate a Refund Transfer.

### header

<ParamField path="checkout_id" type="string">
  The checkout ID that the merchant received in response to the POST Checkout request.
</ParamField>

<ParamField header="Authorization" type="string">
  The authentication token that you will get in the success response on 'verify\_user' api.
</ParamField>

<ParamField header="link-token" type="string">
  The Merchant User Token is received as a response to an `generate_link_token` API call.
</ParamField>

### body

<ParamField body="public_token" type="string">
  The plaid public token that you will get from the frontend side when user select the payment method.
</ParamField>

<ParamField body="plaid_account_id" type="string">
  The plaid\_account\_id you will get from frontend side when user select the payment method.
</ParamField>

### Response

<ResponseField name="success" type="number">
  On success response it will display "payment method saved successfull", and status code 200.
</ResponseField>

<RequestExample>
  ```bash Example Request theme={null}
  curl --location --request POST 'http://127.0.0.1:8000/api/consumers/checkout/{checkout_id}/exchange_public_token/' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Token <token>' \
  --header 'link-token: <link-token>' \
  --data-raw '{ \
      "public_token": "plaid_public_token" \
      "plaid_account_id":"plaid_account_id" \
  }' 
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}

    "message": "payment method saved successfully."
    
  ```
</ResponseExample>
