Cancel a payment intent
curl --request POST \
--url https://payment.gideondevrel.xyz/api/v1/business/payment-intents/{id}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Idempotency-Key: <idempotency-key>'const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
fetch('https://payment.gideondevrel.xyz/api/v1/business/payment-intents/{id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://payment.gideondevrel.xyz/api/v1/business/payment-intents/{id}/cancel"
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://payment.gideondevrel.xyz/api/v1/business/payment-intents/{id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_reference": "<string>",
"amount": {
"currency": "KES",
"value": "<string>"
},
"accepted_payment_methods": [
"mobile_money"
],
"settlement": {
"mode": "stablecoin",
"currency": "KES",
"asset": "USDC",
"chain": "base",
"amount": "<string>",
"exchange_rate": "<string>",
"beneficiary_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payout_status": "<string>",
"payout_transaction_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payout_error": "<string>"
},
"payment_instructions": {
"type": "stablecoin",
"asset": "USDC",
"chain": "base",
"address": "<string>"
},
"status": "awaiting_payment",
"customer": {},
"metadata": {},
"expires_at": "2023-11-07T05:31:56Z",
"cancelled_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": "<unknown>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": "<unknown>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": "<unknown>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": "<unknown>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": "<unknown>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": "<unknown>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": "<unknown>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": "<unknown>"
}
}Payment intents
Cancel a payment intent
Cancels an intent only while its current lifecycle state permits cancellation.
POST
/
api
/
v1
/
business
/
payment-intents
/
{id}
/
cancel
Cancel a payment intent
curl --request POST \
--url https://payment.gideondevrel.xyz/api/v1/business/payment-intents/{id}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Idempotency-Key: <idempotency-key>'const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
fetch('https://payment.gideondevrel.xyz/api/v1/business/payment-intents/{id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://payment.gideondevrel.xyz/api/v1/business/payment-intents/{id}/cancel"
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://payment.gideondevrel.xyz/api/v1/business/payment-intents/{id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_reference": "<string>",
"amount": {
"currency": "KES",
"value": "<string>"
},
"accepted_payment_methods": [
"mobile_money"
],
"settlement": {
"mode": "stablecoin",
"currency": "KES",
"asset": "USDC",
"chain": "base",
"amount": "<string>",
"exchange_rate": "<string>",
"beneficiary_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payout_status": "<string>",
"payout_transaction_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payout_error": "<string>"
},
"payment_instructions": {
"type": "stablecoin",
"asset": "USDC",
"chain": "base",
"address": "<string>"
},
"status": "awaiting_payment",
"customer": {},
"metadata": {},
"expires_at": "2023-11-07T05:31:56Z",
"cancelled_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": "<unknown>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": "<unknown>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": "<unknown>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": "<unknown>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": "<unknown>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": "<unknown>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": "<unknown>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": "<unknown>"
}
}Authorizations
A secret NorthFond business API key. Keep it on your server.
Headers
A unique key for this logical write operation. Reuse it when retrying the exact same request.
Required string length:
8 - 255Path Parameters
NorthFond resource identifier.
Response
Payment intent cancelled
Show child attributes
Show child attributes
Available options:
mobile_money, stablecoin Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
awaiting_payment, funds_detected, processing, completed, expired, cancelled, failed, review_required, approved