Credit the goal for a settled order — the credit doorbell. Confirms the PBA
deposit and credits the goal's leg, gated once-only by `goal_credited`.
Callback-service auth — the Goal Contribution Updater rings it on a SUCCESS
`goal.contribution_order`.
curl --request POST \
--url http://localhost:8080/goals/{goal_id}/contribute \
--header 'Content-Type: application/json' \
--data '
{
"order_id": "<string>"
}
'import requests
url = "http://localhost:8080/goals/{goal_id}/contribute"
payload = { "order_id": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({order_id: '<string>'})
};
fetch('http://localhost:8080/goals/{goal_id}/contribute', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/goals/{goal_id}/contribute",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'order_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:8080/goals/{goal_id}/contribute"
payload := strings.NewReader("{\n \"order_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8080/goals/{goal_id}/contribute")
.header("Content-Type", "application/json")
.body("{\n \"order_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/goals/{goal_id}/contribute")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"order_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"goal": {
"account_id": "<string>",
"contribution_ratio": {
"self_contribution": {
"currency": "INR",
"value": 123
},
"sponsor_contribution": {
"currency": "INR",
"value": 123
}
},
"created_at": "<string>",
"currency": "INR",
"id": "<string>",
"last_modified_at": "<string>",
"others_accumulated": {
"currency": "INR",
"value": 123
},
"periodicity": "<string>",
"purpose": {
"category": "healthcare",
"kind": "CATEGORY"
},
"self_accumulated": {
"currency": "INR",
"value": 123
},
"self_spent": {
"currency": "INR",
"value": 123
},
"sponsor_accumulated": {
"currency": "INR",
"value": 123
},
"sponsor_spent": {
"currency": "INR",
"value": 123
},
"status": "ACTIVE",
"target_amount": {
"currency": "INR",
"value": 123
},
"target_met": true,
"user_id": "012345678901",
"end_date": "2027-01-15",
"mandate_id": "<string>",
"start_date": "2026-01-15"
},
"order": {
"account_id": "<string>",
"amount": {
"currency": "INR",
"value": 123
},
"created_at": "<string>",
"goal_credited": true,
"id": "<string>",
"initial_order_id": "<string>",
"last_modified_at": "<string>",
"medium": "PAYMENT",
"metadata": {
"contribution_channel": "<string>",
"contributor_ref": {
"type": "PHONE",
"value": "<string>"
},
"payment_method": "<string>",
"payment_method_type": "<string>",
"tip_poll_job_id": "<string>"
},
"retry_count": 123,
"source": "<string>",
"status": "EXPRESSED",
"user_id": "012345678901",
"wallet_txn_data": {
"status": "INITIATED"
},
"external_reference_id": "<string>",
"external_status": "<string>",
"goal_id": "<string>",
"job_id": "<string>",
"latest_retry_order_id": "<string>",
"payload": "<unknown>"
}
}Goals
Contribute to Goal (Credit)
POST
/
goals
/
{goal_id}
/
contribute
Credit the goal for a settled order — the credit doorbell. Confirms the PBA
deposit and credits the goal's leg, gated once-only by `goal_credited`.
Callback-service auth — the Goal Contribution Updater rings it on a SUCCESS
`goal.contribution_order`.
curl --request POST \
--url http://localhost:8080/goals/{goal_id}/contribute \
--header 'Content-Type: application/json' \
--data '
{
"order_id": "<string>"
}
'import requests
url = "http://localhost:8080/goals/{goal_id}/contribute"
payload = { "order_id": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({order_id: '<string>'})
};
fetch('http://localhost:8080/goals/{goal_id}/contribute', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/goals/{goal_id}/contribute",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'order_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:8080/goals/{goal_id}/contribute"
payload := strings.NewReader("{\n \"order_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8080/goals/{goal_id}/contribute")
.header("Content-Type", "application/json")
.body("{\n \"order_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/goals/{goal_id}/contribute")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"order_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"goal": {
"account_id": "<string>",
"contribution_ratio": {
"self_contribution": {
"currency": "INR",
"value": 123
},
"sponsor_contribution": {
"currency": "INR",
"value": 123
}
},
"created_at": "<string>",
"currency": "INR",
"id": "<string>",
"last_modified_at": "<string>",
"others_accumulated": {
"currency": "INR",
"value": 123
},
"periodicity": "<string>",
"purpose": {
"category": "healthcare",
"kind": "CATEGORY"
},
"self_accumulated": {
"currency": "INR",
"value": 123
},
"self_spent": {
"currency": "INR",
"value": 123
},
"sponsor_accumulated": {
"currency": "INR",
"value": 123
},
"sponsor_spent": {
"currency": "INR",
"value": 123
},
"status": "ACTIVE",
"target_amount": {
"currency": "INR",
"value": 123
},
"target_met": true,
"user_id": "012345678901",
"end_date": "2027-01-15",
"mandate_id": "<string>",
"start_date": "2026-01-15"
},
"order": {
"account_id": "<string>",
"amount": {
"currency": "INR",
"value": 123
},
"created_at": "<string>",
"goal_credited": true,
"id": "<string>",
"initial_order_id": "<string>",
"last_modified_at": "<string>",
"medium": "PAYMENT",
"metadata": {
"contribution_channel": "<string>",
"contributor_ref": {
"type": "PHONE",
"value": "<string>"
},
"payment_method": "<string>",
"payment_method_type": "<string>",
"tip_poll_job_id": "<string>"
},
"retry_count": 123,
"source": "<string>",
"status": "EXPRESSED",
"user_id": "012345678901",
"wallet_txn_data": {
"status": "INITIATED"
},
"external_reference_id": "<string>",
"external_status": "<string>",
"goal_id": "<string>",
"job_id": "<string>",
"latest_retry_order_id": "<string>",
"payload": "<unknown>"
}
}