Update Sub-Payee

If you need to update the settlement details for an existing sub-payee, please follow the instructions below.

Endpoint

PUT https://api.bindpay.xyz/v1/update-subpayee

Headers

Header Name
Value
Description

Content-Type

application/json

The content type of the request body

x-api-key

Your API key

The subpayee creation API key of the parent business

To update sub-payees' settlement details, you need to use the sub-payee creation API key generated within the sub-payee management section of the developer portal - app.bindpay.xyz

Request Body

Field Name
Type
Description

subPayeeApiKey

string

The API key of the subpayee to be updated

toChain

string

The new chain ID of the destination blockchain

toToken

string

The new token address on the destination blockchain

toAddress

string

The new wallet address of the subpayee

Notes:

  • All fields in the request body are required.

  • The toChain, toToken, and toAddress fields define the new settlement details for the subpayee.

  • Ensure the toAddress is a valid wallet address on the specified blockchain.

  • Pay special attention to the note about the subpayee creation API key, as it's different from the regular API key.

Example Request

curl -X PUT "https://api.bindpay.xyz/v1/update-subpayee" \
     -H "Content-Type: application/json" \
     -H "x-api-key: your_subpayee_creation_api_key_here" \
     -d '{
       "subPayeeApiKey": "existing-subpayee-api-key",
       "toChain": "137",
       "toToken": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
       "toAddress": "0x742d35Cc6634C0532925a3b844Bc454e4438f44b"
     }'

Notes:

  • The code above demonstrates how to make the API call.

  • Replace your_subpayee_creation_api_key_here with the actual subpayee creation API key - same for existing_subpayee_api_key.

  • The example uses Polygon (chain ID 137) and USDC token address on Polygon as placeholders and remember it is a PUT request.

Successful Response

{
  "message": "Subpayee settlement details updated successfully",
  "previousDetails": {
    "toChain": "1",
    "toToken": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "toAddress": "0x1234567890123456789012345678901234567890",
    "updatedAt": "2023-04-15T12:34:56.789Z"
  }
}

Notes:

  • Despite the settlement details changing, the subpayees API key will remain the same.

  • The response includes the previously stored settlement details for the sub-payee.

  • The updatedAt field in the previousDetails shows when the previous settlement details were set.

Error Responses

Status Code
Error Type
Description

400

Bad Request

The request was invalid. This occurs when the API key is missing or when required fields in the request body are missing.

401

Unauthorized

The provided subpayee creation API key is invalid.

404

Not Found

The parent business associated with the provided subpayee creation API key was not found, or the specified sub-payee was not found.

422

Unprocessable Entity

The request was well-formed but contains invalid data (e.g., invalid blockchain address or chain ID).

429

Too Many Requests

The user has sent too many requests in a given amount of time.

500

Internal Server Error

The server encountered an unexpected condition that prevented it from fulfilling the request.

Notes:

  • Error responses use standard HTTP status codes for easy interpretation.

  • The 400 status code indicates client-side errors (e.g., missing fields).

  • The 404 status code specifically indicates that either the parent business or the sub-payee was not found.

Still having issues? Reach out to us at support@bindpay.xyz

Last updated