# Partners

## GET /v1/crm/partners

>

```json
{"openapi":"3.0.0","info":{"title":"Gormic CRM API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"ListPartnersApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/ListPartners_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"ListPartners_Data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PartnerMapSummary"}}},"required":["items"]},"PartnerMapSummary":{"type":"object","properties":{"domain":{"type":"string"},"locales":{"type":"object"},"id":{"type":"string"}},"required":["domain","locales","id"]}}},"paths":{"/v1/crm/partners":{"get":{"operationId":"Partners_list","parameters":[{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListPartnersApiResponse"}}}}},"tags":["Partners"]}}}}
```

## GET /v1/crm/partners/{uid}

>

```json
{"openapi":"3.0.0","info":{"title":"Gormic CRM API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"GetPartnerApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/GetPartner_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"GetPartner_Data":{"type":"object","properties":{"item":{"$ref":"#/components/schemas/GetPartner_Data_Item"}},"required":["item"]},"GetPartner_Data_Item":{"type":"object","properties":{"domain":{"type":"string"},"locales":{"type":"object"},"id":{"type":"string"},"programs":{"type":"array","items":{"$ref":"#/components/schemas/ProgramMap"}}},"required":["domain","locales","id","programs"]},"ProgramMap":{"type":"object","properties":{"locales":{"type":"object"},"excludedLevels":{"type":"object"},"period":{"type":"number","nullable":true},"periodUnit":{"type":"object"},"alias":{"type":"string","nullable":true},"id":{"type":"string"},"benefits":{"type":"array","items":{"$ref":"#/components/schemas/BenefitMap"}}},"required":["locales","id","benefits"]},"BenefitMap":{"type":"object","properties":{"locales":{"type":"object"},"type":{"type":"string","enum":["dicount-flat","discount-absolute","discount-percent","free-dessert","free-drink","priority"]},"amount":{"type":"number"},"discountRef":{"type":"string","nullable":true},"sortNumber":{"type":"number","nullable":true},"id":{"type":"string"},"uid":{"type":"string"},"rules":{"type":"array","items":{"$ref":"#/components/schemas/BenefitRuleM"}},"createdAt":{"type":"string"},"createdVia":{"type":"string"},"createdBy":{"type":"string"},"updatedAt":{"type":"string"},"updatedVia":{"type":"string"},"updatedBy":{"type":"string"}},"required":["locales","type","amount","id","uid","rules"]},"BenefitRuleM":{"type":"object","properties":{"conditions":{"type":"array","items":{"$ref":"#/components/schemas/BenefitRuleM_ConditionsItem"}},"action":{"type":"string","enum":["apply","exclude"]},"sortNumber":{"type":"number"},"id":{"type":"string"},"uid":{"type":"string"},"createdAt":{"type":"string"},"createdVia":{"type":"string"},"createdBy":{"type":"string"},"updatedAt":{"type":"string"},"updatedVia":{"type":"string"},"updatedBy":{"type":"string"}},"required":["conditions","action","sortNumber","id","uid"]},"BenefitRuleM_ConditionsItem":{"type":"object","properties":{"key":{"type":"string","enum":["basic.date","basic.day","basic.time"]},"operator":{"type":"string","enum":["contains","endsWith","equals","greater","greaterOrEquals","in","less","lessOrEquals","notEquals","startsWith"]},"value":{"type":"string"}},"required":["key","operator","value"]},"GetPartnerApiError":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/GetPartner_Error"}},"required":["error"]},"GetPartner_Error":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/GetPartner_ErrorCodes_enum"}]}},"required":["code"]},"GetPartner_ErrorCodes_enum":{"type":"string","enum":["NotFound"]}}},"paths":{"/v1/crm/partners/{uid}":{"get":{"operationId":"Partners_get","parameters":[{"name":"uid","required":true,"in":"path","schema":{"type":"string"}},{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetPartnerApiResponse"}}}},"400":{"description":"Functional Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetPartnerApiError"}}}}},"tags":["Partners"]}}}}
```

## GET /v1/crm/partners/{uid}/customers

>

```json
{"openapi":"3.0.0","info":{"title":"Gormic CRM API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"FetchTagCustomersApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/FetchTagCustomers_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"FetchTagCustomers_Data":{"type":"object","properties":{"customers":{"type":"array","items":{"$ref":"#/components/schemas/FetchTagCustomers_Data_CustomersItem"}},"count":{"type":"number"},"next":{"type":"string"}},"required":["customers"]},"FetchTagCustomers_Data_CustomersItem":{"type":"object","properties":{"customerUid":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"gender":{"type":"string"},"tagEligible":{"type":"string"},"tagAssigned":{"type":"string"},"tagEffectiveStartTime":{"type":"string"},"tagEffectiveEndTime":{"type":"string","nullable":true},"tagAssignmentUid":{"type":"string","nullable":true}},"required":["customerUid","firstName","lastName","gender","tagEligible","tagAssigned","tagEffectiveStartTime","tagEffectiveEndTime","tagAssignmentUid"]},"FetchTagCustomersApiError":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/FetchTagCustomers_Error"}},"required":["error"]},"FetchTagCustomers_Error":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/FetchTagCustomers_ErrorCodes_enum"}]}},"required":["code"]},"FetchTagCustomers_ErrorCodes_enum":{"type":"string","enum":["UNSUPPORTED_DATA_MODEL_PARAM"]}}},"paths":{"/v1/crm/partners/{uid}/customers":{"get":{"operationId":"Partners_listCustomers","parameters":[{"name":"uid","required":true,"in":"path","schema":{"type":"string"}},{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FetchTagCustomersApiResponse"}}}},"400":{"description":"Functional Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FetchTagCustomersApiError"}}}}},"tags":["Partners"]}}}}
```

## POST /v1/crm/partners/{uid}/member

>

```json
{"openapi":"3.0.0","info":{"title":"Gormic CRM API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"AddPartnerMemberApiRequest":{"type":"object","properties":{"params":{"$ref":"#/components/schemas/AddPartnerMember_Params"}},"required":["params"]},"AddPartnerMember_Params":{"type":"object","properties":{"membershipId":{"type":"string"}},"required":["membershipId"]},"AddPartnerMemberApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/AddPartnerMember_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"AddPartnerMember_Data":{"type":"object","properties":{"succeed":{"type":"boolean"},"programs":{"type":"array","items":{"$ref":"#/components/schemas/ProgramMap"}}},"required":["succeed","programs"]},"ProgramMap":{"type":"object","properties":{"locales":{"type":"object"},"excludedLevels":{"type":"object"},"period":{"type":"number","nullable":true},"periodUnit":{"type":"object"},"alias":{"type":"string","nullable":true},"id":{"type":"string"},"benefits":{"type":"array","items":{"$ref":"#/components/schemas/BenefitMap"}}},"required":["locales","id","benefits"]},"BenefitMap":{"type":"object","properties":{"locales":{"type":"object"},"type":{"type":"string","enum":["dicount-flat","discount-absolute","discount-percent","free-dessert","free-drink","priority"]},"amount":{"type":"number"},"discountRef":{"type":"string","nullable":true},"sortNumber":{"type":"number","nullable":true},"id":{"type":"string"},"uid":{"type":"string"},"rules":{"type":"array","items":{"$ref":"#/components/schemas/BenefitRuleM"}},"createdAt":{"type":"string"},"createdVia":{"type":"string"},"createdBy":{"type":"string"},"updatedAt":{"type":"string"},"updatedVia":{"type":"string"},"updatedBy":{"type":"string"}},"required":["locales","type","amount","id","uid","rules"]},"BenefitRuleM":{"type":"object","properties":{"conditions":{"type":"array","items":{"$ref":"#/components/schemas/BenefitRuleM_ConditionsItem"}},"action":{"type":"string","enum":["apply","exclude"]},"sortNumber":{"type":"number"},"id":{"type":"string"},"uid":{"type":"string"},"createdAt":{"type":"string"},"createdVia":{"type":"string"},"createdBy":{"type":"string"},"updatedAt":{"type":"string"},"updatedVia":{"type":"string"},"updatedBy":{"type":"string"}},"required":["conditions","action","sortNumber","id","uid"]},"BenefitRuleM_ConditionsItem":{"type":"object","properties":{"key":{"type":"string","enum":["basic.date","basic.day","basic.time"]},"operator":{"type":"string","enum":["contains","endsWith","equals","greater","greaterOrEquals","in","less","lessOrEquals","notEquals","startsWith"]},"value":{"type":"string"}},"required":["key","operator","value"]},"AddPartnerMemberApiError":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/AddPartnerMember_Error"}},"required":["error"]},"AddPartnerMember_Error":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/AddPartnerMember_ErrorCodes_enum"}]}},"required":["code"]},"AddPartnerMember_ErrorCodes_enum":{"type":"string","enum":["AlreadyLinked","AttemptsExceeded","EmailNotMatch","InvalidOTP","InvalidOTPToken","OTPExpired","UnknowPartner"]}}},"paths":{"/v1/crm/partners/{uid}/member":{"post":{"operationId":"Partners_addMember","parameters":[{"name":"uid","required":true,"in":"path","schema":{"type":"string"}},{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddPartnerMemberApiRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddPartnerMemberApiResponse"}}}},"400":{"description":"Functional Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddPartnerMemberApiError"}}}}},"tags":["Partners"]}}}}
```

## DELETE /v1/crm/partners/{uid}/member/{membershipUid}

>

```json
{"openapi":"3.0.0","info":{"title":"Gormic CRM API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"RemovePartnerMemberApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/RemovePartnerMember_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"RemovePartnerMember_Data":{"type":"object","properties":{"succeed":{"type":"boolean"}},"required":["succeed"]},"RemovePartnerMemberApiError":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/RemovePartnerMember_Error"}},"required":["error"]},"RemovePartnerMember_Error":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/RemovePartnerMember_ErrorCodes_enum"}]}},"required":["code"]},"RemovePartnerMember_ErrorCodes_enum":{"type":"string","enum":["NOT_BELONG_TO_PARTNER"]}}},"paths":{"/v1/crm/partners/{uid}/member/{membershipUid}":{"delete":{"operationId":"Partners_deleteMember","parameters":[{"name":"uid","required":true,"in":"path","schema":{"type":"string"}},{"name":"membershipUid","required":true,"in":"path","schema":{"type":"string"}},{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemovePartnerMemberApiResponse"}}}},"400":{"description":"Functional Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemovePartnerMemberApiError"}}}}},"tags":["Partners"]}}}}
```

## POST /v1/crm/partners/register

>

```json
{"openapi":"3.0.0","info":{"title":"Gormic CRM API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"RegisterPartnererMemberApiRequest":{"type":"object","properties":{"params":{"$ref":"#/components/schemas/RegisterPartnererMember_Params"}},"required":["params"]},"RegisterPartnererMember_Params":{"type":"object","properties":{"email":{"type":"string"}},"required":["email"]},"RegisterPartnererMemberApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/RegisterPartnererMember_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"RegisterPartnererMember_Data":{"type":"object","properties":{"token":{"type":"string"},"creationTime":{"type":"number"},"life":{"type":"number"}},"required":["token","creationTime","life"]},"RegisterPartnererMemberApiError":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/RegisterPartnererMember_Error"}},"required":["error"]},"RegisterPartnererMember_Error":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/RegisterPartnererMember_ErrorCodes_enum"}]}},"required":["code"]},"RegisterPartnererMember_ErrorCodes_enum":{"type":"string","enum":["AlreadyLinked","InvalidToken","UnknowPartner"]}}},"paths":{"/v1/crm/partners/register":{"post":{"operationId":"Partners_register","parameters":[{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterPartnererMemberApiRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterPartnererMemberApiResponse"}}}},"400":{"description":"Functional Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterPartnererMemberApiError"}}}}},"tags":["Partners"]}}}}
```

## POST /v1/crm/partners/verify

>

```json
{"openapi":"3.0.0","info":{"title":"Gormic CRM API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"VerifyPartnerRegistrationApiRequest":{"type":"object","properties":{"params":{"$ref":"#/components/schemas/VerifyPartnerRegistration_Params"}},"required":["params"]},"VerifyPartnerRegistration_Params":{"type":"object","properties":{"email":{"type":"string"},"otp":{"type":"string"},"otpToken":{"type":"string"}},"required":["email","otp","otpToken"]},"VerifyPartnerRegistrationApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/VerifyPartnerRegistration_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"VerifyPartnerRegistration_Data":{"type":"object","properties":{"succeed":{"type":"boolean"},"programs":{"type":"array","items":{"$ref":"#/components/schemas/ProgramMap"}}},"required":["succeed","programs"]},"ProgramMap":{"type":"object","properties":{"locales":{"type":"object"},"excludedLevels":{"type":"object"},"period":{"type":"number","nullable":true},"periodUnit":{"type":"object"},"alias":{"type":"string","nullable":true},"id":{"type":"string"},"benefits":{"type":"array","items":{"$ref":"#/components/schemas/BenefitMap"}}},"required":["locales","id","benefits"]},"BenefitMap":{"type":"object","properties":{"locales":{"type":"object"},"type":{"type":"string","enum":["dicount-flat","discount-absolute","discount-percent","free-dessert","free-drink","priority"]},"amount":{"type":"number"},"discountRef":{"type":"string","nullable":true},"sortNumber":{"type":"number","nullable":true},"id":{"type":"string"},"uid":{"type":"string"},"rules":{"type":"array","items":{"$ref":"#/components/schemas/BenefitRuleM"}},"createdAt":{"type":"string"},"createdVia":{"type":"string"},"createdBy":{"type":"string"},"updatedAt":{"type":"string"},"updatedVia":{"type":"string"},"updatedBy":{"type":"string"}},"required":["locales","type","amount","id","uid","rules"]},"BenefitRuleM":{"type":"object","properties":{"conditions":{"type":"array","items":{"$ref":"#/components/schemas/BenefitRuleM_ConditionsItem"}},"action":{"type":"string","enum":["apply","exclude"]},"sortNumber":{"type":"number"},"id":{"type":"string"},"uid":{"type":"string"},"createdAt":{"type":"string"},"createdVia":{"type":"string"},"createdBy":{"type":"string"},"updatedAt":{"type":"string"},"updatedVia":{"type":"string"},"updatedBy":{"type":"string"}},"required":["conditions","action","sortNumber","id","uid"]},"BenefitRuleM_ConditionsItem":{"type":"object","properties":{"key":{"type":"string","enum":["basic.date","basic.day","basic.time"]},"operator":{"type":"string","enum":["contains","endsWith","equals","greater","greaterOrEquals","in","less","lessOrEquals","notEquals","startsWith"]},"value":{"type":"string"}},"required":["key","operator","value"]},"VerifyPartnerRegistrationApiError":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/VerifyPartnerRegistration_Error"}},"required":["error"]},"VerifyPartnerRegistration_Error":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/VerifyPartnerRegistration_ErrorCodes_enum"}]}},"required":["code"]},"VerifyPartnerRegistration_ErrorCodes_enum":{"type":"string","enum":["AlreadyLinked","AttemptsExceeded","EmailNotMatch","InvalidOTP","InvalidOTPToken","OTPExpired","UnknowPartner"]}}},"paths":{"/v1/crm/partners/verify":{"post":{"operationId":"Partners_verify","parameters":[{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyPartnerRegistrationApiRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyPartnerRegistrationApiResponse"}}}},"400":{"description":"Functional Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyPartnerRegistrationApiError"}}}}},"tags":["Partners"]}}}}
```
