Get checkout URL of an invoice
Get checkout URL of an invoice by id and redirect url.
Endpoint
GET /integration/invoice/{id}/checkout-redirect
HTTP Request
GET /integration/invoice/{id}/checkout-redirect?redirectUrl={url}
Query parameters
| Name | Description | Required | Type |
|---|---|---|---|
| id | Identifier of the invoice | Yes | string |
| url | The redirect url. | No | string |
Successful response
"checkout-url"
Response parameters
| Name | Description | Type |
|---|---|---|
| checkoutUrl | The checkout url. | string |
Erroneous response
{
"code": "404",
"reason": "Invoice not found."
}
Responses
| Code | Description |
|---|---|
| 200 | Successful operation |
| 400 | Invalid request |
| 401 | Unauthorized |
| 404 | Not found |
| 500 | Unexpected error |
Examples
curl https://api.bluetape.com/genericBthubService/integration/invoice/<invoiceId>/checkout-redirect \
-X GET \
-H "X-BlueTape-Key: <your-key>" \
-H "X-Integration-AccountId: <your-account-id>" \
-d "redirectUrl={url}" \
import fetch from 'node-fetch';
const invoiceId = '27be905508e7';
const url = `https://api.bluetape.com/genericBthubService/integration/invoice/${invoiceId}/checkout-redirect?redirectUrl=${url}`;
const options = {
method: 'GET',
headers: {
'X-BlueTape-Key': '<your-key>',
'X-Integration-AccountId': '<your-account-id>',
'Content-Type': 'application/json'
}
};
fetch(url, options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
using Flurl.Http;
var result = await "https://api.bluetape.com/genericBthubService/integration/invoice/{invoiceId}/checkout-redirect"
.SetQueryParams(new {
redirectUrl = url,
})
.WithHeader("X-BlueTape-Key", "<your-key>")
.WithHeader("X-Integration-AccountId", "<your-account-id>")
.WithHeader("Content-Type", "application/json")
.GetAsync();
import requests
url = "https://api.bluetape.com/genericBthubService/integration/invoice/<invoiceId>/checkout-redirect?redirectUrl=<url>"
headers = {
"X-BlueTape-Key": "<your-key>",
"X-Integration-AccountId": "<your-account-id>",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
print(response.text)