The Sales Draft Customers API (/v1/sales/draft/customers) manages the onboarding lifecycle for provisional customer accounts and field sales leads before they are permanently converted to productive Business Partners in GOAL and SAP Business One.
/v1/sales/draft/customers
App\Http\Controllers\V1\Backend\Sales\Draft\DraftCustomerControllerroutes/v1/backend/sales/draft/draft-customers.phproutes/v1/backend/sales/draft/draft.php inside routes/v1/backend/sales/sales.php.| Header | Type | Description |
|---|---|---|
Authorization |
string |
Bearer <access_token> OAuth2 Bearer token. |
x-app-stage |
string |
Tenant environment (dev, staging, prod). |
x-app-uid |
string |
Authenticated user application UUID. |
Content-Type |
string |
application/json (or multipart/form-data where applicable). |
Accept |
string |
application/json. |
All requests must supply companyId (as query parameter ?companyId={id} or within the JSON body) to satisfy the company-validator pipeline.
| Method | Endpoint | Description |
|---|---|---|
GET |
/v1/sales/draft/customers |
Paginated listing of draft customers with filters |
POST |
/v1/sales/draft/customers |
Register a new provisional draft customer |
GET |
/v1/sales/draft/customers/{id} |
Retrieve draft customer by primary integer ID |
GET |
/v1/sales/draft/customers/uuid/{uuid} |
Retrieve draft customer by unique UUID |
PUT |
/v1/sales/draft/customers/{id} |
Update draft customer data |
PUT |
/v1/sales/draft/customers/uuid/{uuid} |
Update draft customer by client UUID (mobile before goalId is known) |
PATCH |
/v1/sales/draft/customers/{id} |
Partial update of draft customer fields |
DELETE |
/v1/sales/draft/customers/{id} |
Soft delete draft customer (status = 'D') |
POST |
/v1/sales/draft/customers/{id}/restore |
Restore soft-deleted draft customer |
POST |
/v1/sales/draft/customers/{id}/submit |
Transition draft to SUBMITTED state for supervisor review |
POST |
/v1/sales/draft/customers/{id}/place |
Place draft into territory/route assignment queue |
POST |
/v1/sales/draft/customers/{id}/approve |
Approve draft customer and initiate ERP synchronization |
POST |
/v1/sales/draft/customers/{id}/deny |
Reject draft customer with observation reason |
POST |
/v1/sales/draft/customers/{id}/validate |
Execute pre-flight data completeness and SUNAT validation |
Provisional customers transition through the following pipeline:
GET /v1/sales/draft/customers?companyId=1&page=1&per_page=15&search=BODEGA&status=A
companyId (int, required): Company ID.page (int, default: 1): Page number.per_page (int, default: 15): Items per page.search (string, optional): Search by commercial name, legal name, or document number.workflow_status (string, optional): Filter by DRAFT, SUBMITTED, PLACED, APPROVED, DENIED.sales_team_id (int, optional): Filter by assigned sales team.territory_id (int, optional): Filter by territory ID.200 OK{
"success": true,
"message": "Operación exitosa.",
"data": {
"current_page": 1,
"data": [
{
"id": 482,
"uuid": "7c9b31d8-0e31-489d-92a1-ff443a059b01",
"company_id": 1,
"business_name": "BODEGA DOÑA ROSA E.I.R.L.",
"commercial_name": "BODEGA DOÑA ROSA",
"doc_type": "RUC",
"doc_number": "20601234567",
"phone": "998877665",
"email": "contacto@donarosa.pe",
"address": "Av. Los Precursores 450",
"ubigeo": "150132",
"latitude": -12.0854,
"longitude": -77.0345,
"sales_team_id": 4,
"territory_id": 12,
"business_type_id": 2,
"workflow_status": "SUBMITTED",
"status": "A",
"created_at": "2026-10-12T14:30:00Z",
"updated_at": "2026-10-13T09:15:00Z"
}
],
"total": 1,
"per_page": 15
}
}
POST /v1/sales/draft/customers
uuid generated on the device before the first local save.uuid already exists for the same company_id, the API returns 200 OK with the existing row (no duplicate insert). Retries after offline queue replay are safe.data always includes both id (integer PK) and uuid (unchanged client value).draft-customers)_id = uuid (same value as the mobile client).PUT sync the Couch row by that _id.{
"companyId": 1,
"uuid": "3a7c6f01-5d98-44a1-b8d2-aa3399ee8812",
"business_name": "MINIMARKET EL TREBOL S.A.C.",
"commercial_name": "EL TREBOL",
"doc_type": "RUC",
"doc_number": "20549876543",
"phone": "987654321",
"email": "ventas@eltrebol.pe",
"address": "Jr. Bolognesi 128",
"ubigeo": "150101",
"latitude": -12.046374,
"longitude": -77.042793,
"sales_team_id": 2,
"territory_id": 8,
"business_type_id": 1,
"payment_term_id": 1
}
201 Created (new row) or 200 OK (existing uuid, idempotent){
"success": true,
"message": "Cliente borrador creado con éxito.",
"data": {
"id": 483,
"uuid": "3a7c6f01-5d98-44a1-b8d2-aa3399ee8812",
"company_id": 1,
"business_name": "MINIMARKET EL TREBOL S.A.C.",
"doc_number": "20549876543",
"workflow_status": "DRAFT",
"status": "A",
"created_at": "2026-10-13T16:20:00Z"
}
}
POST /v1/sales/draft/customers/{id}/submit
SUBMITTED.POST /v1/sales/draft/customers/{id}/place
PLACED.POST /v1/sales/draft/customers/{id}/approve
BusinessPartner record and queueing SAP Business One OCRD creation.POST /v1/sales/draft/customers/{id}/deny
{
"companyId": 1,
"reason": "RUC en estado BAJA DEFINITIVA en SUNAT."
}
POST /v1/sales/draft/customers/{id}/validate