Skip to main content

Save Billing Address

Use this api to save billing address

Flow: Update existing billing address. If it couldn't find one, create new.

URL : billing/{order_number}

Method : POST

Params : order_number

Validate Rule

'phone' => ['required', 'string'],
'type' => ['required', 'int', Rule::in([0,1])],
'company_name' => ['required_if:type,0', 'string'],
'address' => ['required', 'string'],
'email' => ['required', 'email'],
'tax_code' => ['required_if:type,0', 'string'],
'customer_name' => ['required_if:type,1', 'string'],

Enum

type: 
0 - Company
1 - Personal

Example Company

{
"type": 0,
"phone": "0964558412",
"company_name": "Test company",
"address": "Test Address 2",
"email": "test@gmail.com",
"tax_code": "THUE1541151"
}

Example Personal

{
"type": 1,
"phone": "0964558412",
"customer_name": "Name",
"address": "Test Address 2",
"email": "test@gmail.com"
}

Success Response

Code : 200 OK

Content example

{
"result": "success",
"error": "",
"error_code": "",
"data": {
"type": 0,
"customer_name": null,
"order_id": 303053,
"phone": "0964558412",
"company_name": "Test company",
"address": "Test Address 2",
"email": "test@gmail.com",
"tax_code": "THUE1541151",
"status": 1
}
}