Merchant kyc
Merchant Kyc
Service ini digunakan untuk mengupload dokumen kyc merchant
Upload Dokumen
Untuk Proses upload dokumen KYC data yang harus di upload berjumlah 6, partner harus melakukan upload berkala pada service ini hingga 6 file, karena kami hanya menerima 1 file tiap request untuk menghindari limit
Generate Signature
Untuk proses generate signature sedikit berbeda, yang digenerate tanpa key img
, karena pasti berbeda vakue dari image path
Berikut Contoh payload yang di generate, tanpa key img
{
"merchantId":"121xxxx",
"type":"ktp",
"no_ktp":"123456789032xxxx",
};
Ketika dokumen KYC di proses maka speedcash akan mengirimkan callback status dari KYC
Service Info
HTTP Method | POST |
---|---|
Service Code | 24 |
Http Method | POST FormData |
Path | .../v1.0/merchant/upload |
Authentication | OAuth 2.0 |
Header
Header Name | Tipe Data | Wajib | Deskripsi |
---|---|---|---|
Content-Type | String | Y | application/json |
X-TIMESTAMP | String | Y | Waktu lokal klien saat ini yyyy-MM-ddTHH:mm:ss.SSSTZD format |
X-PARTNER-ID | String | Y | Client’s client_id (diberikan pada saat onboarding ) |
X-CHANNEL-ID | String | Y | ID channel merchant |
X-SIGNATURE | String | Y | Dibuat dengan algoritma asymmetric with token : Signature Generation |
X-EXTERNAL-ID | String | Y | ID external merchant (tidak boleh sama di hari yang sama) |
Body
Nama Field | Tipe Data | Wajib | Deskripsi |
---|---|---|---|
merchantId | String | Y | Kode Unik Setiap Merchant |
type | String | Y | Tipe dari dokumen yang di upload ktp - selfie - npwp - toko1 - toko2 - toko3 untuk tipe npwp wajib jika merchant type 1 |
img | path | Y | image file path |
no_ktp | string | Y | nomor ktp |
no_npwp | String | C | Nomor npwp Wajib jika merchant type 1 |
- JSON
- CURL
- PHP
- NODE JS
- GO
# untuk dokumen ktp
{
"merchantId":"121xxxx",
"type":"ktp",
"img": "/path/ktp.png",
"no_ktp":"123456789032xxxx",
};
# untuk dokumen selfie
{
"merchantId":"121xxxx",
"type":"selfie",
"img": "/path/selfie.png"
};
# untuk dokumen npwp
{
"merchantId":"121xxxx",
"type":"npwp",
"img": "/path/npwp.png",
"no_npwp" : "123456789032xxxx"
};
# untuk dokumen toko1
{
"merchantId":"121xxxx",
"type":"toko1",
"img": "/path/toko3.png",
"merchant_location" : "12412312-5123124xxxx"
};
# untuk dokumen toko2
{
"merchantId":"121xxxx",
"type":"toko2",
"img": "/path/toko3.png",
"merchant_location" : "12412312-5123124xxxx"
};
# untuk dokumen toko3
{
"merchantId":"121xxxx",
"type":"toko3",
"img": "/path/toko3.png",
"merchant_location" : "12412312-5123124xxxx"
};
curl --location --request POST '../v1.0/merchant/upload' \
--header 'x-timestamp: 2024-11-12T07:23:21.194Z' \
--header 'x-signature: bRieWp4E5cBbCSvqENBA+5OzwmxR+rJtuy9bmjQkfRAuaZu+Vm/jOmKirzSyfTHZdvb2GuRofUTicvP7ko4dUg==' \
--header 'x-partner-id: 6c57db4e-9e11-4951-9bcf-d6f177dafbcc' \
--header 'channel-id: 0002' \
--header 'x-external-id: {{externalId}}' \
--header 'Authorization: Bearer 4c333b35-8342-42cf-bb1a-a71f64c144f7' \
--form 'merchantId="121xxxx"' \
--form 'type="ktp"' \
--form 'img=@"/assets/img/user/ktp.png"' \
--form 'no_ktp="123456789032xxxx"'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '../v1.0/merchant/upload',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('merchantId' => '121xxxx','type' => 'ktp','img'=> new CURLFILE('/assets/img/user/ktp.png'),'no_ktp' => '123456789032xxxx'),
CURLOPT_HTTPHEADER => array(
'x-timestamp: 2024-11-12T07:23:21.194Z',
'x-signature: bRieWp4E5cBbCSvqENBA+5OzwmxR+rJtuy9bmjQkfRAuaZu+Vm/jOmKirzSyfTHZdvb2GuRofUTicvP7ko4dUg==',
'x-partner-id: 6c57db4e-9e11-4951-9bcf-d6f177dafbcc',
'channel-id: 0002',
'x-external-id: {{externalId}}',
'Authorization: Bearer 4c333b35-8342-42cf-bb1a-a71f64c144f7'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
vvar request = require('request');
var fs = require('fs');
var options = {
'method': 'POST',
'url': '../v1.0/merchant/upload',
'headers': {
'x-timestamp': '2024-11-12T07:23:21.194Z',
'x-signature': 'bRieWp4E5cBbCSvqENBA+5OzwmxR+rJtuy9bmjQkfRAuaZu+Vm/jOmKirzSyfTHZdvb2GuRofUTicvP7ko4dUg==',
'x-partner-id': '6c57db4e-9e11-4951-9bcf-d6f177dafbcc',
'channel-id': '0002',
'x-external-id': '{{externalId}}',
'Authorization': 'Bearer 4c333b35-8342-42cf-bb1a-a71f64c144f7'
},
formData: {
'merchantId': '121xxxx',
'type': 'ktp',
'img': {
'value': fs.createReadStream('/assets/img/user/ktp.png'),
'options': {
'filename': 'profile.png',
'contentType': null
}
},
'no_ktp': '123456789032xxxx'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "../v1.0/merchant/detail"
method := "POST"
payload := strings.NewReader(`{
"merchantId" : "121xxxx"
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("x-client-key", "6c57db4e-9e11-4951-9bcf-d6f177dafbcc")
req.Header.Add("x-timestamp", "2024-01-16T10:54:21+07:00")
req.Header.Add("x-signature", "qrQQSSkvCXxYE3MWJpsn+loHuh4+1xlNWEF6oKmqJgbBJHYqnYoBAYgsv/+DXC7dMeGgdu2dkbXBuMQUD/cGZQ==")
req.Header.Add("x-partner-id", "6c57db4e-9e11-4951-9bcf-d6f177dafbcc")
req.Header.Add("channel-id", " 23412")
req.Header.Add("x-external-id", "2024-05-15T06:57:04.004Z")
req.Header.Add("Content-Type", " application/json")
req.Header.Add("Authorization", "Bearer 6430fe8b-79d5-4e58-a337-6eb498e117a5")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
Response
Parameter | Tipe Data | Deskripsi |
---|---|---|
responseCode | String | Kode response |
responseMessage | String | Pesan response |
{
"responseCode": "2002400",
"responseMessage": "SuccessFully",
}
List Response Code
Response Code | Response Message | Description |
---|---|---|
2002400 | Success | |
4002401 | Invalid field format { field name } | |
4012400 | Unauthorized. Invalid Signature | X-Signature salah |
4092400 | Cannot use same X-EXTERNAL-ID in same day | X-External-ID sudah pernah digunakan di hari yang sama |
4042401 | Bad Request | Request header ada yang salah / kurang |
4042400 | Unauthorized. Client Forbidden Access API | Partner tidak dapat mengakses api terkait |
4002401 | Request Failed | Terjadi kesalahan |
Handle KYC Callback
Setelah Dokumen berhasil di proses, Speedcash akan mengirimkan callback ke partner untuk memberitahukan status dari KYC merchant. Partner harus mengimplementasikan service untuk menerima callback dari SpeedCash.
Callback Info
Service Code | 20 |
HTTP Method | POST |
Path | {{yoururl}}/v1.0/merchant/callback |
Callback Payload
Parameter | Tipe Data | Deskripsi |
---|---|---|
merchantId | String | Kode unik yang di miliki setiap merchant. |
mid | String | Merchant Unqiue Id |
nmid | String | National merchant Id |
mpan | String | Merchant Presented Mode |
verifyStatus | Integer | Status dari callback 1 - Diterima 2 - Ditolak |
description | String | Deksripsi status. |
note | String | Catatan dari OS. |
typeCallback | String | Tipe Callback 1 - REGISTRATION 2 - KYC |
{
"merchantId": "121xxxx",
"verifyStatus": 2,
"description": "rejected",
"note": "Data foto [kartu identitas/selfie] [kurang jelas/kabur/tidak sesuai]. Mohon perbaiki dan ulangi ya, kak. Team CS kami dengan senang hati akan bantu kakak jika kesulitan",
"typeCallback": "KYC"
}
Expected Results
Response yang diharapkan dari partner adalah sebagai berikut:
{
"responseCode": "2002000",
"responseMessage": "success"
}