---
agentTools:
  projectIndex: https://docs.quidax.io/llms.txt
---

# Create an Auto Swap

The Auto Swap feature creates a static bank account for a customer. Any fiat payment sent to this bank account is automatically converted to the selected crypto currency and sent to the customer’s crypto wallet.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Ramp Merchant API",
    "version": "3.0"
  },
  "servers": [
    {
      "url": "https://ramp-be.quidax.io/api/v1/merchants/"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "name": "x-private-key",
        "in": "header",
        "x-default": "secret_key"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/custodial/auto_swap/initiate_onramp": {
      "post": {
        "summary": "Create an Auto Swap",
        "description": "The Auto Swap feature creates a static bank account for a customer. Any fiat payment sent to this bank account is automatically converted to the selected crypto currency and sent to the customer’s crypto wallet.",
        "operationId": "auto-swap",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "customer": {
                    "type": "object",
                    "description": "Details of the customer who owns the static bank account.",
                    "properties": {
                      "email": {
                        "type": "string",
                        "description": "Note: Please use your company domain for the email extension.",
                        "default": "test@domain.com"
                      },
                      "first_name": {
                        "type": "string",
                        "description": "Please use the customer's first name, as it is the name the system will use for comparison before approving the deposit.",
                        "default": "test"
                      },
                      "last_name": {
                        "type": "string",
                        "description": "Please use the customer's last name, as it is the name the system will use for comparison before approving the deposit.",
                        "default": "user"
                      }
                    }
                  },
                  "coin_deposit": {
                    "type": "object",
                    "description": "The crypto wallet where the converted crypto will be sent.",
                    "properties": {
                      "address": {
                        "type": "string",
                        "description": "wallet address where crypto will be deposited"
                      },
                      "network": {
                        "type": "string",
                        "description": "blockchain network, for example erc20"
                      },
                      "currency": {
                        "type": "string",
                        "description": "The crypto currency the fiat deposit will be converted to, for example usdt"
                      }
                    }
                  },
                  "bank_account": {
                    "type": "object",
                    "description": "Bank details needed to create the static bank account.",
                    "properties": {
                      "bvn": {
                        "type": "string",
                        "description": "customer’s Bank Verification Number"
                      },
                      "bank_code": {
                        "type": "string",
                        "description": "Customer’s bank account. Allowed values are 035 - Wema Bank"
                      },
                      "currency": {
                        "type": "string",
                        "description": "Bank account currency, for example ngn."
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"status\": \"ok\",\n  \"message\": \"Auto swap successfully created\",\n  \"data\": {\n    \"public_id\": \"c869619a-ce05-4111-95bf-a09559d053a3\",\n    \"customer\": {\n      \"email\": \"customer8446f9b6-ef27-4602-961b-367db7422829@example.com\",\n      \"first_name\": \"john\",\n      \"last_name\": \"doe\"\n    },\n    \"side\": \"onramp\",\n    \"deposit_bank_account\": {\n      \"account_number\": \"1234567890\",\n      \"account_name\": \"Test user\",\n      \"currency\": \"ngn\",\n      \"bank_name\": \"Kuda bank\",\n      \"bank_code\": \"011\"\n    }\n  }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "ok"
                    },
                    "message": {
                      "type": "string",
                      "example": "Auto swap successfully created"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "public_id": {
                          "type": "string",
                          "example": "c869619a-ce05-4111-95bf-a09559d053a3"
                        },
                        "customer": {
                          "type": "object",
                          "properties": {
                            "email": {
                              "type": "string",
                              "example": "customer8446f9b6-ef27-4602-961b-367db7422829@example.com"
                            },
                            "first_name": {
                              "type": "string",
                              "example": "john"
                            },
                            "last_name": {
                              "type": "string",
                              "example": "doe"
                            }
                          }
                        },
                        "side": {
                          "type": "string",
                          "example": "onramp"
                        },
                        "deposit_bank_account": {
                          "type": "object",
                          "properties": {
                            "account_number": {
                              "type": "string",
                              "example": "1234567890"
                            },
                            "account_name": {
                              "type": "string",
                              "example": "Test user"
                            },
                            "currency": {
                              "type": "string",
                              "example": "ngn"
                            },
                            "bank_name": {
                              "type": "string",
                              "example": "Kuda bank"
                            },
                            "bank_code": {
                              "type": "string",
                              "example": "011"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Invalid customer information": {
                    "value": "{\n  \"status\": \"bad_request\",\n  \"message\": \"customer email is missing, customer first_name must be filled\",\n  \"data\": null\n}"
                  },
                  "Invalid BVN error": {
                    "value": "{\n  \"status\": \"bad_request\",\n  \"message\": \"Invalid BVN\",\n  \"data\": null\n}"
                  },
                  "Invalid reference": {
                    "value": "{\n  \"status\": \"bad_request\",\n  \"message\": \"Auto swap already exists with a different merchant reference\",\n  \"data\": null\n}"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "title": "Invalid customer information",
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "example": "bad_request"
                        },
                        "message": {
                          "type": "string",
                          "example": "customer email is missing, customer first_name must be filled"
                        },
                        "data": {}
                      }
                    },
                    {
                      "title": "Invalid BVN error",
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "example": "bad_request"
                        },
                        "message": {
                          "type": "string",
                          "example": "Invalid BVN"
                        },
                        "data": {}
                      }
                    },
                    {
                      "title": "Invalid reference",
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "example": "bad_request"
                        },
                        "message": {
                          "type": "string",
                          "example": "Auto swap already exists with a different merchant reference"
                        },
                        "data": {}
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "6981ba5faf9470ee082aeecd:6a428aa7fac9c58dabf0d8ad"
}
```