Merchant Register
Merchant Register
Service ini digunakan untuk melakukan proses registrasi merchant (jika ingin via api)
info
Ketika merchant sukses di proses maka speedcash akan mengirimkan callback status registrasi
Service Info
HTTP Method | POST |
---|---|
Service Code | 20 |
Http Method | POST |
Path | .../v1.0/merchant/registration |
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 |
---|---|---|---|
nama_pemilik | String | Y | Nama Dari Pemilik |
nama_outlet | String | Y | Nama outlet |
notelp_pemilik | String | Y | Nomor telepon pemilik |
notelp_outlet | String | Y | Nomor Telepon outlet |
nik | String | Y | Nomor NIK |
kewarganegaraan | String | Y | Kode kewarganegaraan wajib berisi ID |
id_provinsi_pemilik | String | N | id provinsi pemilik |
id_kota_pemilik | String | N | id kota pemilik |
id_kecamatan_pemilik | String | N | id kecamatan pemilik |
id_kelurahan_pemilik | String | N | id kelurahan pemilik |
kode_pos_pemilik | String | N | kode pos pemilik |
id_provinsi_outlet | String | Y | id provinsi outlet |
id_kota_outlet | String | Y | id kota outlet |
id_kecamatan_outlet | String | Y | id kecamatan outlet |
id_kelurahan_outlet | String | Y | id kelurahan outlet |
alamat_outlet | String | Y | alamat outlet |
kode_pos_outlet | String | Y | kode pos outlet |
type_merchant | String | Y | tipe dari merchant 0 - Individu 1 - Badan Usaha |
kriteria | String | Y | krtieria merchant |
mcc | String | Y | Merchant kategori code |
npwp | String | C | Nomor npwp jika type_merchant 1 maka wajib |
is_onlishop | Integer | Y | Platgrom usaha merchant 0 - offline 1 - online |
- JSON
- CURL
- PHP
- NODE JS
- GO
{
"nama_pemilik": "rosidi dragon",
"nama_outlet": "rosididragon store",
"notelp_pemilik": "6281200xxxxx",
"notelp_outlet": "6281200xxxxx",
"email_pemilik": "rosididragon@gmail.com",
"email_outlet": "rosididragon@gmail.com",
"nik": "292828182832xxxx",
"kewarganegaraan": "ID",
"id_provinsi_pemilik": "28",
"id_kota_pemilik": "253",
"id_kecamatan_pemilik": "2487",
"id_kelurahan_pemilik": "31014",
"kode_pos_pemilik": "09645",
"alamat_pemilik": "Jl. Mayjend Prof. Dr. Moestopo No. 6, Surabaya, Jawa Timur",
"id_provinsi_outlet": "28",
"id_kota_outlet": "253",
"id_kecamatan_outlet": "2487",
"id_kelurahan_outlet": "31014",
"alamat_outlet": "Jl. Prof. Moh. Hasan Simpang Surabaya",
"kode_pos_outlet": "11170",
"type_merchant": "0",
"kriteria": "UKE",
"mcc": "5812",
"npwp": "0",
"is_onlineshop": 0
};
curl --location --request POST '.../v1.0/merchant/registration' \
--header 'x-client-key: 6c57db4e-9e11-4951-9bcf-d6f177dafbcc' \
--header 'x-timestamp: 2024-01-16T10:54:21+07:00' \
--header 'x-signature: qrQQSSkvCXxYE3MWJpsn+loHuh4+1xlNWEF6oKmqJgbBJHYqnYoBAYgsv/+DXC7dMeGgdu2dkbXBuMQUD/cGZQ==' \
--header 'x-partner-id: 6c57db4e-9e11-4951-9bcf-d6f177dafbcc' \
--header 'channel-id: 23412' \
--header 'x-external-id: 2024-05-15T06:56:02.642Z' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 6430fe8b-79d5-4e58-a337-6eb498e117a5' \
--data-raw '{
"nama_pemilik":"rosidi dragon",
"nama_outlet":"rosididragon store",
"notelp_pemilik":"6281200xxxxx",
"notelp_outlet":"6281200xxxxx",
"email_pemilik":"rosididragon@gmail.com",
"email_outlet":"rosididragon@gmail.com",
"nik":"292828182832xxxx",
"kewarganegaraan":"ID",
"id_provinsi_pemilik":"28",
"id_kota_pemilik": "253",
"id_kecamatan_pemilik":"2487",
"id_kelurahan_pemilik":"31014",
"kode_pos_pemilik": "09645",
"alamat_pemilik":"Jl. Mayjend Prof. Dr. Moestopo No. 6, Surabaya, Jawa Timur",
"id_provinsi_outlet":"28",
"id_kota_outlet":"253",
"id_kecamatan_outlet":"2487",
"id_kelurahan_outlet": "31014",
"alamat_outlet":"Jl. Prof. Moh. Hasan Simpang Surabaya",
"kode_pos_outlet":"11170",
"type_merchant":"0",
"kriteria":"UKE",
"mcc":"5812",
"npwp":"0",
"is_onlineshop":0
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '../v1.0/merchant/registration',
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 =>'{
"nama_pemilik":"rosidi dragon",
"nama_outlet":"rosididragon store",
"notelp_pemilik":"6281200xxxxx",
"notelp_outlet":"6281200xxxxx",
"email_pemilik":"rosididragon@gmail.com",
"email_outlet":"rosididragon@gmail.com",
"nik":"292828182832xxxx",
"kewarganegaraan":"ID",
"id_provinsi_pemilik":"28",
"id_kota_pemilik": "253",
"id_kecamatan_pemilik":"2487",
"id_kelurahan_pemilik":"31014",
"kode_pos_pemilik": "09645",
"alamat_pemilik":"Jl. Mayjend Prof. Dr. Moestopo No. 6, Surabaya, Jawa Timur",
"id_provinsi_outlet":"28",
"id_kota_outlet":"253",
"id_kecamatan_outlet":"2487",
"id_kelurahan_outlet": "31014",
"alamat_outlet":"Jl. Prof. Moh. Hasan Simpang Surabaya",
"kode_pos_outlet":"11170",
"type_merchant":"0",
"kriteria":"UKE",
"mcc":"5812",
"npwp":"0",
"is_onlineshop":0
}',
CURLOPT_HTTPHEADER => array(
'x-client-key: 6c57db4e-9e11-4951-9bcf-d6f177dafbcc',
'x-timestamp: 2024-01-16T10:54:21+07:00',
'x-signature: qrQQSSkvCXxYE3MWJpsn+loHuh4+1xlNWEF6oKmqJgbBJHYqnYoBAYgsv/+DXC7dMeGgdu2dkbXBuMQUD/cGZQ==',
'x-partner-id: 6c57db4e-9e11-4951-9bcf-d6f177dafbcc',
'channel-id: 23412',
'x-external-id: 2024-05-15T06:56:18.301Z',
'Content-Type: application/json',
'Authorization: Bearer 6430fe8b-79d5-4e58-a337-6eb498e117a5'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'POST',
'url': '../v1.0/merchant/registration',
'headers': {
'x-client-key': '6c57db4e-9e11-4951-9bcf-d6f177dafbcc',
'x-timestamp': '2024-01-16T10:54:21+07:00',
'x-signature': 'qrQQSSkvCXxYE3MWJpsn+loHuh4+1xlNWEF6oKmqJgbBJHYqnYoBAYgsv/+DXC7dMeGgdu2dkbXBuMQUD/cGZQ==',
'x-partner-id': '6c57db4e-9e11-4951-9bcf-d6f177dafbcc',
'channel-id': ' 23412',
'x-external-id': '2024-05-15T06:56:45.081Z',
'Content-Type': ' application/json',
'Authorization': 'Bearer 6430fe8b-79d5-4e58-a337-6eb498e117a5'
},
body: '{
"nama_pemilik" : "ainul nosidi",
"nama_outlet" :"ainul nosidi store",
"notelp_pemilik" :"6281200261413",
"notelp_outlet" :"6281200261413",
"email_pemilik" :"ainulnosidi@gmail.com",
"email_outlet" :"ainulnosidi@gmail.com",
"nik" :"1254291912652621",
"kewarganegaraan" : "ID",
"id_provinsi_pemilik" :"28",
"id_kota_pemilik" :"253",
"id_kecamatan_pemilik" : "2487",
"id_kelurahan_pemilik" : "31014",
"kode_pos_pemilik" :"09645",
"alamat_pemilik" :"Jl. Mayjend Prof. Dr. Moestopo No. 6, Surabaya, Jawa Timur",
"id_provinsi_outlet" :"28",
"id_kota_outlet" :"253",
"id_kecamatan_outlet" : "2487",
"id_kelurahan_outlet" : "31014",
"alamat_outlet" :"Jl. Prof. Moh. Hasan Simpang Surabaya",
"kode_pos_outlet" :"11170",
"type_merchant" :"1",
"kriteria" :"UKE",
"mcc" :"5812",
"npwp" :"1254291912029182",
"is_onlineshop" : 0
}'
};
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/registration"
method := "POST"
payload := strings.NewReader(`{
"nama_pemilik": "rosidi dragon",
"nama_outlet": "rosididragon store",
"notelp_pemilik": "6281200xxxxx",
"notelp_outlet": "6281200xxxxx",
"email_pemilik": "rosididragon@gmail.com",
"email_outlet": "rosididragon@gmail.com",
"nik": "292828182832xxxx",
"kewarganegaraan": "ID",
"id_provinsi_pemilik": "28",
"id_kota_pemilik": "253",
"id_kecamatan_pemilik": "2487",
"id_kelurahan_pemilik": "31014",
"kode_pos_pemilik": "09645",
"alamat_pemilik": "Jl. Mayjend Prof. Dr. Moestopo No. 6, Surabaya, Jawa Timur",
"id_provinsi_outlet": "28",
"id_kota_outlet": "253",
"id_kecamatan_outlet": "2487",
"id_kelurahan_outlet": "31014",
"alamat_outlet": "Jl. Prof. Moh. Hasan Simpang Surabaya",
"kode_pos_outlet": "11170",
"type_merchant": "0",
"kriteria": "UKE",
"mcc": "5812",
"npwp": "0",
"is_onlineshop": 0
}`)
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 |
additionalInfo | Object | Informasi tambahan. |
merchantId | String | Kode unik setiap merchant |
{
"responseCode": "2002000",
"responseMessage": "Successful",
"additionalInfo": {
"merchantId": "1252xxxxx"
}
}
List Response Code
Response Code | Response Message | Description |
---|---|---|
2002000 | Success | |
4002001 | Invalid field format { field name } | |
4012000 | Unauthorized. Invalid Signature | X-Signature salah |
4092000 | Cannot use same X-EXTERNAL-ID in same day | X-External-ID sudah pernah digunakan di hari yang sama |
4042001 | Bad Request | Request header ada yang salah / kurang |
4042000 | Unauthorized. Client Forbidden Access API | Partner tidak dapat mengakses api terkait |
4002000 | Failed Register Merchant {keterangan} | Proses Registrasi merchant gagal |
4032001 | merchant already register {keterangan} | Nomor telepon sudah di daftarkan |
5002001 | General Error | Terjadi kesalahan |
Handle Registration Callback
Setelah proses registrasi merchant sudah di proses oleh PTEN, Speedcash akan mengirimkan callback ke partner untuk memberitahukan status 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",
"mid": "REJECTED",
"nmid": "REJECTED",
"mpan": "936008153000146xxxx",
"verifyStatus": 2,
"description": "rejected",
"note": "koreksi mcc",
"typeCallback": "REGISTRATION"
}
Expected Results
Response yang diharapkan dari partner adalah sebagai berikut:
{
"responseCode": "2002000",
"responseMessage": "success"
}