---
agentTools:
  projectIndex: https://chimoney.readme.io/llms.txt
---

# Redeem any.

Redeems a Chimoney transaction using the `chiRef` and allows for custom data to be passed in the redemption process.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Chimoney API Docs",
    "version": "0.2.4",
    "description": "This is the latest version of the Chimoney API. For deprecated version routes, please refer to /v0.2/api-docs."
  },
  "security": [
    {
      "apiKeyAuth": []
    }
  ],
  "servers": [
    {
      "url": "https://api.chimoney.io/",
      "description": "Prod Server"
    },
    {
      "url": "https://api-v2-sandbox.chimoney.io",
      "description": "Sandbox API v2 (v0.2.4)"
    }
  ],
  "paths": {
    "/v0.2.4/redeem/any": {
      "post": {
        "summary": "Redeem any.",
        "tags": [
          "Redeem"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "subAccount": {
                    "type": "string",
                    "description": "Subaccount if any.",
                    "example": "1234567"
                  },
                  "chiRef": {
                    "type": "string",
                    "description": "Chi reference.",
                    "example": "1234567"
                  },
                  "meta": {
                    "type": "object",
                    "description": "Any data to be sent along with the request.",
                    "properties": {
                      "test": {
                        "type": "boolean",
                        "example": true
                      }
                    }
                  },
                  "redeemData": {
                    "type": "object",
                    "description": "Data needed to redeem. See examples in body.",
                    "example": {
                      "countryCode": "US",
                      "productId": "5",
                      "email": "test@gmail.com"
                    }
                  }
                },
                "required": [
                  "chiRef",
                  "redeemData"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "success"
                    },
                    "message": {
                      "type": "string",
                      "example": "Redeemed successfully"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "payoutLink": {
                          "type": "string",
                          "example": "http://localhost:4000/pay/?issueID=eaabe2eb-e774-4f81-8ba9-ede2ea2d0058_5_1726506283562"
                        },
                        "error": {
                          "type": "string",
                          "example": "None"
                        },
                        "timeStamp": {
                          "type": "string",
                          "example": "2024-09-16 17:12:21"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string",
                          "example": "/orders"
                        },
                        "errorCode": {
                          "type": "string",
                          "example": "INVALID_INPUT_PROVIDED"
                        },
                        "infoLink": {
                          "type": "string",
                          "nullable": true,
                          "example": null
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          },
                          "example": []
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationError"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/TransactionNotFoundError"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-KEY"
      }
    },
    "responses": {
      "Forbidden": {
        "description": "Access to this resource is forbidden.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Forbidden"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Access to this resource is not available for unauthenticated users.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Unauthorized"
            }
          }
        }
      },
      "ServerError": {
        "description": "Indicates an internal server error.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ServerError"
            }
          }
        }
      },
      "ValidationError": {
        "description": "Validation error in the request.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ValidationError"
            }
          }
        }
      },
      "TransactionNotFoundError": {
        "description": "Error indicating that the transaction was not found.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/TransactionNotFoundError"
            }
          }
        }
      }
    },
    "schemas": {
      "Forbidden": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Status of the response.",
            "example": "error"
          },
          "error": {
            "type": "string",
            "description": "Error message indicating forbidden access.",
            "example": "API Access not enabled for account Test. Email support@chimoney.io"
          }
        }
      },
      "Unauthorized": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Status of the response.",
            "example": "error"
          },
          "error": {
            "type": "string",
            "description": "Error message indicating unauthorized access.",
            "example": "API key is not defined. Generate a new one from the developer portal."
          }
        }
      },
      "ServerError": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Status of the error.",
            "example": "error"
          },
          "type": {
            "type": "string",
            "description": "Type of server error.",
            "example": "server error"
          },
          "code": {
            "type": "string",
            "description": "Specific error code for server issues.",
            "example": "INTERNAL_SERVER_ERROR"
          },
          "message": {
            "type": "string",
            "description": "Detailed message explaining the issue.",
            "example": "An internal server error occurred."
          }
        }
      },
      "ValidationError": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Status of the validation error.",
            "example": "error"
          },
          "type": {
            "type": "string",
            "description": "Type of validation error.",
            "example": "Validation Error"
          },
          "code": {
            "type": "string",
            "description": "Error code indicating validation issue.",
            "example": "INVALID_REQUEST"
          },
          "message": {
            "type": "string",
            "description": "Detailed validation error message.",
            "example": "The request parameters are invalid."
          }
        }
      },
      "TransactionNotFoundError": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Status of the error.",
            "example": "error"
          },
          "type": {
            "type": "string",
            "description": "Type of error indicating transaction not found.",
            "example": "Resource Not Found"
          },
          "code": {
            "type": "string",
            "description": "Error code for transaction not found.",
            "example": "TRANSACTION_NOT_FOUND"
          },
          "message": {
            "type": "string",
            "description": "Detailed message explaining the transaction not found error.",
            "example": "The transaction with the provided ID could not be found."
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Redeem",
      "description": "All redeem operations."
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 102,
      "1": 208,
      "2": 243,
      "3": 240,
      "4": 73,
      "5": 214,
      "6": 34,
      "7": 0,
      "8": 37,
      "9": 190,
      "10": 200,
      "11": 166
    }
  }
}
```