> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.sqril.io/llms.txt.
> For full documentation content, see https://docs.sqril.io/llms-full.txt.

# Register Customer

POST https://api.sqril.com/registerCustomer
Content-Type: application/json

Registers or upserts a customer sender profile for the authenticated account.

**Authentication:**

- **REQUIRED**: Basic Auth only (`Authorization: Basic base64(client_id:client_secret)`).
    

**Behavior:**

1. Validates required sender fields (flat JSON at root, not nested under `sender`).
    
2. Creates (201) or updates (200) the registered customer profile under your account.
    

**Response:**

- Returns `customer_id`, normalized sender fields, and `created_at` / `updated_at` when available.
    

`customer_id` returned here is required for `decodeQr`, `getQuotation`, and `executePayout`.

**Field code references:**

- `ic_type` must be one of the supported identification document type codes: `NIC`, `PP`, `WEP`.
    
- `occupation` must be one of the supported occupation codes: `OCC1` through `OCC11`.

Reference: https://docs.sqril.io/sqril-saa-s-api/payout-endpoints/register-customer

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /registerCustomer:
    post:
      operationId: register-customer
      summary: Register Customer
      description: >-
        Registers or upserts a customer sender profile for the authenticated
        account.


        **Authentication:**


        - **REQUIRED**: Basic Auth only (`Authorization: Basic
        base64(client_id:client_secret)`).
            

        **Behavior:**


        1. Validates required sender fields (flat JSON at root, not nested under
        `sender`).
            
        2. Creates (201) or updates (200) the registered customer profile under
        your account.
            

        **Response:**


        - Returns `customer_id`, normalized sender fields, and `created_at` /
        `updated_at` when available.
            

        `customer_id` returned here is required for `decodeQr`, `getQuotation`,
        and `executePayout`.


        **Field code references:**


        - `ic_type` must be one of the supported identification document type
        codes: `NIC`, `PP`, `WEP`.
            
        - `occupation` must be one of the supported occupation codes: `OCC1`
        through `OCC11`.
      tags:
        - subpackage_payoutEndpoints
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Payout Endpoints_Register
                  Customer_Response_201
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PostRegistercustomerRequestBadRequestError
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name_first:
                  type: string
                name_last:
                  type: string
                gender:
                  type: string
                ic_number:
                  type: string
                ic_type:
                  type: string
                ic_country:
                  type: string
                occupation:
                  type: string
                country_of_residence:
                  type: string
                phone:
                  type: string
                email:
                  type: string
                  format: email
                nationality:
                  type: string
                dob:
                  type: string
                  format: date
                address:
                  type: string
                ic_expiry_date:
                  type: string
                  format: date
              required:
                - name_first
                - name_last
                - gender
                - ic_number
                - ic_type
                - ic_country
                - occupation
                - country_of_residence
                - phone
                - email
                - nationality
                - dob
                - address
                - ic_expiry_date
servers:
  - url: https://api.sqril.com
  - url: https://your-app.com
components:
  schemas:
    Payout Endpoints_Register Customer_Response_201:
      type: object
      properties:
        customer_id:
          type: string
        name_first:
          type: string
        name_last:
          type: string
        gender:
          type: string
        ic_number:
          type: string
        ic_type:
          type: string
        ic_country:
          type: string
        occupation:
          type: string
        country_of_residence:
          type: string
        phone:
          type: string
        email:
          type: string
          format: email
        nationality:
          type: string
        dob:
          type: string
          format: date
        address:
          type: string
        ic_expiry_date:
          type: string
          format: date
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - customer_id
        - name_first
        - name_last
        - gender
        - ic_number
        - ic_type
        - ic_country
        - occupation
        - country_of_residence
        - phone
        - email
        - nationality
        - dob
        - address
        - ic_expiry_date
        - created_at
        - updated_at
      title: Payout Endpoints_Register Customer_Response_201
    RegisterCustomerPostResponsesContentApplicationJsonSchemaDetailsValidationErrorsItems:
      type: object
      properties:
        field:
          type: string
        message:
          type: string
      required:
        - field
        - message
      title: >-
        RegisterCustomerPostResponsesContentApplicationJsonSchemaDetailsValidationErrorsItems
    RegisterCustomerPostResponsesContentApplicationJsonSchemaDetails:
      type: object
      properties:
        validation_errors:
          type: array
          items:
            $ref: >-
              #/components/schemas/RegisterCustomerPostResponsesContentApplicationJsonSchemaDetailsValidationErrorsItems
      required:
        - validation_errors
      title: RegisterCustomerPostResponsesContentApplicationJsonSchemaDetails
    PostRegistercustomerRequestBadRequestError:
      type: object
      properties:
        error_code:
          type: string
        error_message:
          type: string
        details:
          $ref: >-
            #/components/schemas/RegisterCustomerPostResponsesContentApplicationJsonSchemaDetails
      required:
        - error_code
        - error_message
        - details
      title: PostRegistercustomerRequestBadRequestError

```

## SDK Code Examples

```python Payout Endpoints_Register Customer_example
import requests

url = "https://api.sqril.com/registerCustomer"

payload = {
    "name_first": "John",
    "name_last": "Doe",
    "gender": "M",
    "ic_number": "3201234567890123",
    "ic_type": "PP",
    "ic_country": "ID",
    "occupation": "OCC9",
    "country_of_residence": "ID",
    "phone": "+62812345678",
    "email": "john.doe@example.com",
    "nationality": "ID",
    "dob": "1990-01-01",
    "address": "Jl. Sudirman No. 123, Jakarta",
    "ic_expiry_date": "2030-12-31"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Payout Endpoints_Register Customer_example
const url = 'https://api.sqril.com/registerCustomer';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"name_first":"John","name_last":"Doe","gender":"M","ic_number":"3201234567890123","ic_type":"PP","ic_country":"ID","occupation":"OCC9","country_of_residence":"ID","phone":"+62812345678","email":"john.doe@example.com","nationality":"ID","dob":"1990-01-01","address":"Jl. Sudirman No. 123, Jakarta","ic_expiry_date":"2030-12-31"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Payout Endpoints_Register Customer_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.sqril.com/registerCustomer"

	payload := strings.NewReader("{\n  \"name_first\": \"John\",\n  \"name_last\": \"Doe\",\n  \"gender\": \"M\",\n  \"ic_number\": \"3201234567890123\",\n  \"ic_type\": \"PP\",\n  \"ic_country\": \"ID\",\n  \"occupation\": \"OCC9\",\n  \"country_of_residence\": \"ID\",\n  \"phone\": \"+62812345678\",\n  \"email\": \"john.doe@example.com\",\n  \"nationality\": \"ID\",\n  \"dob\": \"1990-01-01\",\n  \"address\": \"Jl. Sudirman No. 123, Jakarta\",\n  \"ic_expiry_date\": \"2030-12-31\"\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(res)
	fmt.Println(string(body))

}
```

```ruby Payout Endpoints_Register Customer_example
require 'uri'
require 'net/http'

url = URI("https://api.sqril.com/registerCustomer")

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  \"name_first\": \"John\",\n  \"name_last\": \"Doe\",\n  \"gender\": \"M\",\n  \"ic_number\": \"3201234567890123\",\n  \"ic_type\": \"PP\",\n  \"ic_country\": \"ID\",\n  \"occupation\": \"OCC9\",\n  \"country_of_residence\": \"ID\",\n  \"phone\": \"+62812345678\",\n  \"email\": \"john.doe@example.com\",\n  \"nationality\": \"ID\",\n  \"dob\": \"1990-01-01\",\n  \"address\": \"Jl. Sudirman No. 123, Jakarta\",\n  \"ic_expiry_date\": \"2030-12-31\"\n}"

response = http.request(request)
puts response.read_body
```

```java Payout Endpoints_Register Customer_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.sqril.com/registerCustomer")
  .header("Content-Type", "application/json")
  .body("{\n  \"name_first\": \"John\",\n  \"name_last\": \"Doe\",\n  \"gender\": \"M\",\n  \"ic_number\": \"3201234567890123\",\n  \"ic_type\": \"PP\",\n  \"ic_country\": \"ID\",\n  \"occupation\": \"OCC9\",\n  \"country_of_residence\": \"ID\",\n  \"phone\": \"+62812345678\",\n  \"email\": \"john.doe@example.com\",\n  \"nationality\": \"ID\",\n  \"dob\": \"1990-01-01\",\n  \"address\": \"Jl. Sudirman No. 123, Jakarta\",\n  \"ic_expiry_date\": \"2030-12-31\"\n}")
  .asString();
```

```php Payout Endpoints_Register Customer_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.sqril.com/registerCustomer', [
  'body' => '{
  "name_first": "John",
  "name_last": "Doe",
  "gender": "M",
  "ic_number": "3201234567890123",
  "ic_type": "PP",
  "ic_country": "ID",
  "occupation": "OCC9",
  "country_of_residence": "ID",
  "phone": "+62812345678",
  "email": "john.doe@example.com",
  "nationality": "ID",
  "dob": "1990-01-01",
  "address": "Jl. Sudirman No. 123, Jakarta",
  "ic_expiry_date": "2030-12-31"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Payout Endpoints_Register Customer_example
using RestSharp;

var client = new RestClient("https://api.sqril.com/registerCustomer");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name_first\": \"John\",\n  \"name_last\": \"Doe\",\n  \"gender\": \"M\",\n  \"ic_number\": \"3201234567890123\",\n  \"ic_type\": \"PP\",\n  \"ic_country\": \"ID\",\n  \"occupation\": \"OCC9\",\n  \"country_of_residence\": \"ID\",\n  \"phone\": \"+62812345678\",\n  \"email\": \"john.doe@example.com\",\n  \"nationality\": \"ID\",\n  \"dob\": \"1990-01-01\",\n  \"address\": \"Jl. Sudirman No. 123, Jakarta\",\n  \"ic_expiry_date\": \"2030-12-31\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Payout Endpoints_Register Customer_example
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "name_first": "John",
  "name_last": "Doe",
  "gender": "M",
  "ic_number": "3201234567890123",
  "ic_type": "PP",
  "ic_country": "ID",
  "occupation": "OCC9",
  "country_of_residence": "ID",
  "phone": "+62812345678",
  "email": "john.doe@example.com",
  "nationality": "ID",
  "dob": "1990-01-01",
  "address": "Jl. Sudirman No. 123, Jakarta",
  "ic_expiry_date": "2030-12-31"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.sqril.com/registerCustomer")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```