更新订阅
curl --request POST \
--url https://api.stage.localpayment.com/api/payin/subscriptions/{externalId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dateToUpdate": "2025-01-30",
"amount": 16000,
"autoRecurring": {
"repetitions": "3",
"type": "month",
"trialDays": "0"
},
"retry": {
"repetitions": 2,
"intervalUnit": "day",
"intervalValue": 1
}
}
'import requests
url = "https://api.stage.localpayment.com/api/payin/subscriptions/{externalId}"
payload = {
"dateToUpdate": "2025-01-30",
"amount": 16000,
"autoRecurring": {
"repetitions": "3",
"type": "month",
"trialDays": "0"
},
"retry": {
"repetitions": 2,
"intervalUnit": "day",
"intervalValue": 1
}
}
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({
dateToUpdate: '2025-01-30',
amount: 16000,
autoRecurring: {repetitions: '3', type: 'month', trialDays: '0'},
retry: {repetitions: 2, intervalUnit: 'day', intervalValue: 1}
})
};
fetch('https://api.stage.localpayment.com/api/payin/subscriptions/{externalId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.stage.localpayment.com/api/payin/subscriptions/{externalId}",
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([
'dateToUpdate' => '2025-01-30',
'amount' => 16000,
'autoRecurring' => [
'repetitions' => '3',
'type' => 'month',
'trialDays' => '0'
],
'retry' => [
'repetitions' => 2,
'intervalUnit' => 'day',
'intervalValue' => 1
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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 := "https://api.stage.localpayment.com/api/payin/subscriptions/{externalId}"
payload := strings.NewReader("{\n \"dateToUpdate\": \"2025-01-30\",\n \"amount\": 16000,\n \"autoRecurring\": {\n \"repetitions\": \"3\",\n \"type\": \"month\",\n \"trialDays\": \"0\"\n },\n \"retry\": {\n \"repetitions\": 2,\n \"intervalUnit\": \"day\",\n \"intervalValue\": 1\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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("https://api.stage.localpayment.com/api/payin/subscriptions/{externalId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dateToUpdate\": \"2025-01-30\",\n \"amount\": 16000,\n \"autoRecurring\": {\n \"repetitions\": \"3\",\n \"type\": \"month\",\n \"trialDays\": \"0\"\n },\n \"retry\": {\n \"repetitions\": 2,\n \"intervalUnit\": \"day\",\n \"intervalValue\": 1\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stage.localpayment.com/api/payin/subscriptions/{externalId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dateToUpdate\": \"2025-01-30\",\n \"amount\": 16000,\n \"autoRecurring\": {\n \"repetitions\": \"3\",\n \"type\": \"month\",\n \"trialDays\": \"0\"\n },\n \"retry\": {\n \"repetitions\": 2,\n \"intervalUnit\": \"day\",\n \"intervalValue\": 1\n }\n}"
response = http.request(request)
puts response.read_body{
"externalId": "564b161a-76ba-4a84-b5cf-583f2df8c377",
"internalId": "52425bbd-b68b-4abc-9480-5ae88d53adb3",
"status": {
"code": "107",
"description": "APPROVED",
"detail": "Update subscription success"
},
"errors": []
}{
"status": {
"code": "400",
"description": "ERROR",
"detail": "Invalid operation"
}
}订阅
更新订阅
POST
/
api
/
payin
/
subscriptions
/
{externalId}
更新订阅
curl --request POST \
--url https://api.stage.localpayment.com/api/payin/subscriptions/{externalId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dateToUpdate": "2025-01-30",
"amount": 16000,
"autoRecurring": {
"repetitions": "3",
"type": "month",
"trialDays": "0"
},
"retry": {
"repetitions": 2,
"intervalUnit": "day",
"intervalValue": 1
}
}
'import requests
url = "https://api.stage.localpayment.com/api/payin/subscriptions/{externalId}"
payload = {
"dateToUpdate": "2025-01-30",
"amount": 16000,
"autoRecurring": {
"repetitions": "3",
"type": "month",
"trialDays": "0"
},
"retry": {
"repetitions": 2,
"intervalUnit": "day",
"intervalValue": 1
}
}
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({
dateToUpdate: '2025-01-30',
amount: 16000,
autoRecurring: {repetitions: '3', type: 'month', trialDays: '0'},
retry: {repetitions: 2, intervalUnit: 'day', intervalValue: 1}
})
};
fetch('https://api.stage.localpayment.com/api/payin/subscriptions/{externalId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.stage.localpayment.com/api/payin/subscriptions/{externalId}",
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([
'dateToUpdate' => '2025-01-30',
'amount' => 16000,
'autoRecurring' => [
'repetitions' => '3',
'type' => 'month',
'trialDays' => '0'
],
'retry' => [
'repetitions' => 2,
'intervalUnit' => 'day',
'intervalValue' => 1
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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 := "https://api.stage.localpayment.com/api/payin/subscriptions/{externalId}"
payload := strings.NewReader("{\n \"dateToUpdate\": \"2025-01-30\",\n \"amount\": 16000,\n \"autoRecurring\": {\n \"repetitions\": \"3\",\n \"type\": \"month\",\n \"trialDays\": \"0\"\n },\n \"retry\": {\n \"repetitions\": 2,\n \"intervalUnit\": \"day\",\n \"intervalValue\": 1\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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("https://api.stage.localpayment.com/api/payin/subscriptions/{externalId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dateToUpdate\": \"2025-01-30\",\n \"amount\": 16000,\n \"autoRecurring\": {\n \"repetitions\": \"3\",\n \"type\": \"month\",\n \"trialDays\": \"0\"\n },\n \"retry\": {\n \"repetitions\": 2,\n \"intervalUnit\": \"day\",\n \"intervalValue\": 1\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stage.localpayment.com/api/payin/subscriptions/{externalId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dateToUpdate\": \"2025-01-30\",\n \"amount\": 16000,\n \"autoRecurring\": {\n \"repetitions\": \"3\",\n \"type\": \"month\",\n \"trialDays\": \"0\"\n },\n \"retry\": {\n \"repetitions\": 2,\n \"intervalUnit\": \"day\",\n \"intervalValue\": 1\n }\n}"
response = http.request(request)
puts response.read_body{
"externalId": "564b161a-76ba-4a84-b5cf-583f2df8c377",
"internalId": "52425bbd-b68b-4abc-9480-5ae88d53adb3",
"status": {
"code": "107",
"description": "APPROVED",
"detail": "Update subscription success"
},
"errors": []
}{
"status": {
"code": "400",
"description": "ERROR",
"detail": "Invalid operation"
}
}此服务允许您更新订阅详情,确保您的定期付款不间断。
授权
请求体
application/json
最后修改于 2026年11月10日

