# Create Onramp URL

## Create Onramp URL

> Creates an onramp URL for cryptocurrency purchase using fiat currency. This endpoint generates a URL that redirects users to the onramp provider's payment widget where they can buy crypto using fiat currency.

```json
{"openapi":"3.0.0","info":{"title":"Onramp API","version":"1.0"},"servers":[{"url":"https://gateway.stage.pay.io","description":"Staging environment"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"API key for authentication. Include as: `Bearer YOUR_API_KEY`"}},"schemas":{"Onramp_Get_Url_Request":{"type":"object","title":"Onramp URL Request","description":"Request to create MELD onramp URL for crypto purchase","required":["provider","currency_id","user_reference_id","country","operation","site","theme"],"properties":{"provider":{"type":"string","description":"Onramp provider (e.g., MELD)","enum":["MELD"]},"merchant_id":{"type":"string","format":"uuid","description":"Merchant identifier (optional)"},"currency_id":{"type":"string","format":"uuid","description":"Currency ID for the crypto to purchase"},"user_reference_id":{"type":"string","description":"Unique user reference identifier"},"country":{"type":"string","description":"User's country code following ISO 3166-1 alpha-2 standard (e.g., US, GB, DE)","pattern":"^[A-Z]{2}$"},"language":{"type":"string","description":"Language code for the onramp provider interface","default":"en"},"operation":{"type":"string","description":"Operation type for the onramp transaction","enum":["deposit"],"default":"deposit"},"site":{"type":"string","description":"Site identifier for redirect URL (e.g., sportsbet.io, bitcasino.io, livecasino.io)"},"theme":{"type":"string","description":"UI theme for the onramp provider widget","enum":["dark","light"],"default":"dark"}}},"Onramp_Get_Url_Response":{"type":"object","title":"Onramp URL Response","description":"Response containing onramp provider URL","required":["success"],"properties":{"success":{"type":"boolean","description":"Operation success status"},"data":{"type":"object","required":["link"],"properties":{"link":{"type":"string","description":"Onramp provider URL for crypto purchase"}}},"error":{"type":"object","nullable":true,"description":"Error details if success is false","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"}}}}},"Error_Response":{"type":"object","description":"Standard error response","properties":{"error":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code"},"details":{"type":"object","description":"Additional error details"}}},"Validation_Error_Response":{"type":"object","description":"Validation error response","properties":{"error":{"type":"string","description":"Error message"},"errors":{"type":"object","description":"Field-specific validation errors","additionalProperties":{"type":"array","items":{"type":"string"}}}}}}},"paths":{"/v1/user/onramp/get_url":{"post":{"summary":"Create Onramp URL","description":"Creates an onramp URL for cryptocurrency purchase using fiat currency. This endpoint generates a URL that redirects users to the onramp provider's payment widget where they can buy crypto using fiat currency.","operationId":"createMeldOnrampUrl","tags":["Onramp"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Onramp_Get_Url_Request"}}}},"responses":{"200":{"description":"Successfully created onramp URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Onramp_Get_Url_Response"}}}},"400":{"description":"Bad Request - Missing or unsupported provider","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error_Response"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error_Response"}}}},"422":{"description":"Validation Error - Invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Validation_Error_Response"}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pay.io/api-reference/user-payment-api/create-onramp-url.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
