Create Refill
curl --request POST \
--url https://app.sosmednext.com/api/v1/refill \
--header 'Content-Type: application/json' \
--data '
{
"order": 123,
"orders": "<string>"
}
'import requests
url = "https://app.sosmednext.com/api/v1/refill"
payload = {
"order": 123,
"orders": "<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: 123, orders: '<string>'})
};
fetch('https://app.sosmednext.com/api/v1/refill', 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://app.sosmednext.com/api/v1/refill",
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' => 123,
'orders' => '<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 := "https://app.sosmednext.com/api/v1/refill"
payload := strings.NewReader("{\n \"order\": 123,\n \"orders\": \"<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("https://app.sosmednext.com/api/v1/refill")
.header("Content-Type", "application/json")
.body("{\n \"order\": 123,\n \"orders\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.sosmednext.com/api/v1/refill")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"order\": 123,\n \"orders\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyAPI Endpoints
Create Refill
Mengajukan permintaan refill untuk pesanan yang memiliki garansi refill.
POST
/
api
/
v1
/
refill
Create Refill
curl --request POST \
--url https://app.sosmednext.com/api/v1/refill \
--header 'Content-Type: application/json' \
--data '
{
"order": 123,
"orders": "<string>"
}
'import requests
url = "https://app.sosmednext.com/api/v1/refill"
payload = {
"order": 123,
"orders": "<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: 123, orders: '<string>'})
};
fetch('https://app.sosmednext.com/api/v1/refill', 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://app.sosmednext.com/api/v1/refill",
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' => 123,
'orders' => '<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 := "https://app.sosmednext.com/api/v1/refill"
payload := strings.NewReader("{\n \"order\": 123,\n \"orders\": \"<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("https://app.sosmednext.com/api/v1/refill")
.header("Content-Type", "application/json")
.body("{\n \"order\": 123,\n \"orders\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.sosmednext.com/api/v1/refill")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"order\": 123,\n \"orders\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyGunakan endpoint ini untuk mengajukan refill pada pesanan yang sudah selesai namun mengalami penurunan (drop). Pastikan layanan yang dipesan memiliki properti
refill: true pada daftar layanan.
Body Parameters (JSON)
ID Order untuk refill satu pesanan.
ID Order dipisahkan koma untuk refill banyak pesanan sekaligus (maks 100 ID). Contoh:
"1010,1011,1012"Catatan: Gunakan salah satu parameterorderatauorders, jangan keduanya bersamaan.
Contoh Request (Single)
curl -X POST \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"order": 9210}' \
"https://app.sosmednext.com/api/v1/refill"
Response Single
Response Sukses (200 OK)
{
"refill": "1"
}
Contoh Request (Multiple)
curl -X POST \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"orders": "9210,9211,9212"}' \
"https://app.sosmednext.com/api/v1/refill"
Response Multiple
Response Sukses (200 OK)
[
{ "order": 9210, "refill": 1 },
{ "order": 9211, "refill": 2 },
{ "order": 9212, "refill": { "error": "Service does not support refill" } }
]
Response Gagal (400)
{
"error": "Order not found"
}
⌘I
