Pay an Invoice
curl --request POST \
--url https://api.arct.cloud/v1/invoices/{invoice_id}/pay \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"payment_method": "credit"
}
'import requests
url = "https://api.arct.cloud/v1/invoices/{invoice_id}/pay"
payload = { "payment_method": "credit" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({payment_method: 'credit'})
};
fetch('https://api.arct.cloud/v1/invoices/{invoice_id}/pay', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_number": "<string>",
"status": "draft",
"subtotal": 123,
"tax": 123,
"total": 123,
"refunded_total": 123,
"period_start": "2023-11-07T05:31:56Z",
"period_end": "2023-11-07T05:31:56Z",
"due_date": "2023-11-07T05:31:56Z",
"paid_at": "2023-11-07T05:31:56Z",
"payment_method": "<string>",
"hosted_invoice_url": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"items": [
{
"description": "<string>",
"quantity": 123,
"unit_price": 123,
"total": 123,
"server_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Invoices
Pay an Invoice
Pays a pending invoice in full from account credit and returns the paid invoice. Add credit in the dashboard under Billing > Account credits.
POST
/
invoices
/
{invoice_id}
/
pay
Pay an Invoice
curl --request POST \
--url https://api.arct.cloud/v1/invoices/{invoice_id}/pay \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"payment_method": "credit"
}
'import requests
url = "https://api.arct.cloud/v1/invoices/{invoice_id}/pay"
payload = { "payment_method": "credit" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({payment_method: 'credit'})
};
fetch('https://api.arct.cloud/v1/invoices/{invoice_id}/pay', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_number": "<string>",
"status": "draft",
"subtotal": 123,
"tax": 123,
"total": 123,
"refunded_total": 123,
"period_start": "2023-11-07T05:31:56Z",
"period_end": "2023-11-07T05:31:56Z",
"due_date": "2023-11-07T05:31:56Z",
"paid_at": "2023-11-07T05:31:56Z",
"payment_method": "<string>",
"hosted_invoice_url": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"items": [
{
"description": "<string>",
"quantity": 123,
"unit_price": 123,
"total": 123,
"server_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Authorizations
API token from Dashboard > Settings > API Tokens.
Path Parameters
Body
application/json
credit pays the full total from account credit.
Allowed value:
"credit"Response
Successful Response
Invoice status enumeration.
Available options:
draft, pending, paid, failed, refunded, cancelled Total, in USD.
Hosted invoice page, or null.
Show child attributes
Show child attributes