> ## Documentation Index
> Fetch the complete documentation index at: https://docs.unyte.africa/llms.txt
> Use this file to discover all available pages before exploring further.

# Purchase a policy

> Purchase a new policy for your customer



## OpenAPI

````yaml post /api/v1/policies
openapi: 3.0.3
info:
  title: Superpool API
  version: 2.0.0
  description: >-
    Insurance infrastructure for Financial Institutions, Insurers, and
    Insurtechs
  contact:
    name: Unyte Africa LTD.
    url: https://ng.unyte.africa
    email: tech@unyte.com
servers: []
security: []
paths:
  /api/v1/policies:
    post:
      tags:
        - Policies
      summary: Purchase a policy
      description: Purchase a new policy for your customer
      operationId: purchase-policy
      parameters:
        - in: header
          name: U-Request-Id
          schema:
            type: string
          description: Idempotency key to enforce idempotent processing of POST requests
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PolicyPurchaseSerializerV3'
            examples:
              PolicyPurchaseRequest:
                value:
                  intent_id: d5c36562-b86f-4e97-8288-8c6cb2da35ef
                  merchant_code: ERO-2635
                  additional_information:
                    make: Honda
                    model: CBR600RR
                    value: 15000
                    owner: Alex Rider
                    year: '2021-05-15'
                    usecase: private
                    vehicle_type: saloon
                    engine_number: ENG567890
                    chassis_number: CHS678901
                    registration_number: MOT1234
                  activation_metadata:
                    renew: true
                    send_customer_notification: true
                summary: Policy Purchase Request
              CargoInsurancePurchaseRequest:
                value:
                  intent_id: d5c36562-b86f-4e97-8288-8c6cb2da35ef
                  merchant_code: ERO-2635
                  additional_information:
                    shipment_type: international
                    shipment_value: 750000.5
                    originating_port: Lagos, Nigeria
                    destination_port: Accra, Ghana
                    shipment_carrier: XYZ Couriers
                    shipment_carrier_details:
                      tracking_number: NG987654321
                      service_type: Air Freight
                    exchange_rate: 750
                    tin_number: TIN-123456
                    lc_number: LLC-123456
                    cac_number: CAC-123456
                    bank_name: GTBank
                    invoice_number: INV-123456
                    currency: USD
                  activation_metadata:
                    renew: true
                    send_customer_notification: true
                summary: Cargo Insurance Purchase Request
              TravelInsurancePurchaseRequest:
                value:
                  intent_id: d5c36562-b86f-4e97-8288-8c6cb2da35ef
                  merchant_code: ERO-2635
                  additional_information:
                    destination: France
                    departure_date: '2023-09-01'
                    return_date: '2023-09-15'
                    number_of_travellers: 2
                    trip_duration: 14
                    trip_type: round_trip
                    trip_type_details: leisure
                    insurance_options: <insurance_plan_or_null>
                  activation_metadata:
                    renew: true
                    send_customer_notification: true
                summary: Travel Insurance Purchase Request
              DeviceInsurancePurchaseRequest:
                value:
                  intent_id: d5c36562-b86f-4e97-8288-8c6cb2da35ef
                  merchant_code: ERO-2635
                  additional_information:
                    device_type: Smartphone
                    make: Samsung
                    model: Galaxy S21
                    value: 100000
                    serial_number: SNG-123456
                    imei: IMEI-123456
                  activation_metadata:
                    renew: true
                    send_customer_notification: true
                summary: Device Insurance Purchase Request
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PolicyPurchaseSerializerV3'
            examples:
              PolicyPurchaseRequest:
                value:
                  intent_id: d5c36562-b86f-4e97-8288-8c6cb2da35ef
                  merchant_code: ERO-2635
                  additional_information:
                    make: Honda
                    model: CBR600RR
                    value: 15000
                    owner: Alex Rider
                    year: '2021-05-15'
                    usecase: private
                    vehicle_type: saloon
                    engine_number: ENG567890
                    chassis_number: CHS678901
                    registration_number: MOT1234
                  activation_metadata:
                    renew: true
                    send_customer_notification: true
                summary: Policy Purchase Request
              CargoInsurancePurchaseRequest:
                value:
                  intent_id: d5c36562-b86f-4e97-8288-8c6cb2da35ef
                  merchant_code: ERO-2635
                  additional_information:
                    shipment_type: international
                    shipment_value: 750000.5
                    originating_port: Lagos, Nigeria
                    destination_port: Accra, Ghana
                    shipment_carrier: XYZ Couriers
                    shipment_carrier_details:
                      tracking_number: NG987654321
                      service_type: Air Freight
                    exchange_rate: 750
                    tin_number: TIN-123456
                    lc_number: LLC-123456
                    cac_number: CAC-123456
                    bank_name: GTBank
                    invoice_number: INV-123456
                    currency: USD
                  activation_metadata:
                    renew: true
                    send_customer_notification: true
                summary: Cargo Insurance Purchase Request
              TravelInsurancePurchaseRequest:
                value:
                  intent_id: d5c36562-b86f-4e97-8288-8c6cb2da35ef
                  merchant_code: ERO-2635
                  additional_information:
                    destination: France
                    departure_date: '2023-09-01'
                    return_date: '2023-09-15'
                    number_of_travellers: 2
                    trip_duration: 14
                    trip_type: round_trip
                    trip_type_details: leisure
                    insurance_options: <insurance_plan_or_null>
                  activation_metadata:
                    renew: true
                    send_customer_notification: true
                summary: Travel Insurance Purchase Request
              DeviceInsurancePurchaseRequest:
                value:
                  intent_id: d5c36562-b86f-4e97-8288-8c6cb2da35ef
                  merchant_code: ERO-2635
                  additional_information:
                    device_type: Smartphone
                    make: Samsung
                    model: Galaxy S21
                    value: 100000
                    serial_number: SNG-123456
                    imei: IMEI-123456
                  activation_metadata:
                    renew: true
                    send_customer_notification: true
                summary: Device Insurance Purchase Request
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PolicyPurchaseSerializerV3'
            examples:
              PolicyPurchaseRequest:
                value:
                  intent_id: d5c36562-b86f-4e97-8288-8c6cb2da35ef
                  merchant_code: ERO-2635
                  additional_information:
                    make: Honda
                    model: CBR600RR
                    value: 15000
                    owner: Alex Rider
                    year: '2021-05-15'
                    usecase: private
                    vehicle_type: saloon
                    engine_number: ENG567890
                    chassis_number: CHS678901
                    registration_number: MOT1234
                  activation_metadata:
                    renew: true
                    send_customer_notification: true
                summary: Policy Purchase Request
              CargoInsurancePurchaseRequest:
                value:
                  intent_id: d5c36562-b86f-4e97-8288-8c6cb2da35ef
                  merchant_code: ERO-2635
                  additional_information:
                    shipment_type: international
                    shipment_value: 750000.5
                    originating_port: Lagos, Nigeria
                    destination_port: Accra, Ghana
                    shipment_carrier: XYZ Couriers
                    shipment_carrier_details:
                      tracking_number: NG987654321
                      service_type: Air Freight
                    exchange_rate: 750
                    tin_number: TIN-123456
                    lc_number: LLC-123456
                    cac_number: CAC-123456
                    bank_name: GTBank
                    invoice_number: INV-123456
                    currency: USD
                  activation_metadata:
                    renew: true
                    send_customer_notification: true
                summary: Cargo Insurance Purchase Request
              TravelInsurancePurchaseRequest:
                value:
                  intent_id: d5c36562-b86f-4e97-8288-8c6cb2da35ef
                  merchant_code: ERO-2635
                  additional_information:
                    destination: France
                    departure_date: '2023-09-01'
                    return_date: '2023-09-15'
                    number_of_travellers: 2
                    trip_duration: 14
                    trip_type: round_trip
                    trip_type_details: leisure
                    insurance_options: <insurance_plan_or_null>
                  activation_metadata:
                    renew: true
                    send_customer_notification: true
                summary: Travel Insurance Purchase Request
              DeviceInsurancePurchaseRequest:
                value:
                  intent_id: d5c36562-b86f-4e97-8288-8c6cb2da35ef
                  merchant_code: ERO-2635
                  additional_information:
                    device_type: Smartphone
                    make: Samsung
                    model: Galaxy S21
                    value: 100000
                    serial_number: SNG-123456
                    imei: IMEI-123456
                  activation_metadata:
                    renew: true
                    send_customer_notification: true
                summary: Device Insurance Purchase Request
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PolicyPurchaseResponse'
              examples:
                SuccessfulPolicyPurchaseExample:
                  value:
                    policy_id: ba4fc272-5591-4812-9f36-48c3ffb27a69
                    policy_reference_number: EXAMPLE-POLICY-NUMBER
                    effective_from: '2022-08-10'
                    effective_through: '2024-12-11'
                    premium: '10000.00'
                    insurer: AXA
                    policy_status: active
                    product_information:
                      product_name: Home Insurance
                      product_type: Home
                      product_description: Home
                    customer_information:
                      customer_name: John Doe
                      customer_email: john.doestar@email.com
                      customer_phone: '1234567890'
                      customer_address: 123 Main St, Springfield, IL
                    renewal_information:
                      renewable: false
                  summary: Successful policy purchase example
          description: Policy purchase successful
        '400':
          description: Bad Request
        '500':
          description: Internal Server Error
      security:
        - ClientKeyAuth: []
components:
  schemas:
    PolicyPurchaseSerializerV3:
      type: object
      description: Improved data handler for policy purchase requests
      properties:
        intent_id:
          type: string
          description: Intent ID
        merchant_code:
          type: string
          description: Merchant or Partner Seller short code
          maxLength: 50
        additional_information:
          description: >-
            Insurance Product-specific additional information required for the
            selected product type e.g {"vehicle_make": "Toyota",
            "vehicle_model": "Camry"}
        activation_metadata:
          $ref: '#/components/schemas/ActivationMetadata'
      required:
        - activation_metadata
        - additional_information
        - intent_id
        - merchant_code
    PolicyPurchaseResponse:
      type: object
      description: Limited view of the PolicySerializer for the purchase response
      properties:
        policy_id:
          type: string
          format: uuid
          description: Unique identifier for the policy
        policy_reference_number:
          type: string
          default: ''
          description: >-
            Policy number issued to the customer as assigned by the insurer e.g
            GI86585700-1
        effective_from:
          type: string
          format: date
          description: Date the policy becomes active - determined by the time of purchase
        effective_through:
          type: string
          format: date
          description: Date the policy expires
        premium:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          description: Amount paid for the policy
        insurer:
          type: string
        policy_status:
          type: string
        product_information:
          type: object
          additionalProperties: {}
          description: Returns the product information as a dictionary
          readOnly: true
        customer_information:
          type: object
          additionalProperties: {}
          description: Returns the customer information as a dictionary
          readOnly: true
        renewal_information:
          type: object
          additionalProperties: {}
          description: Returns the renewal information as a dictionary
          readOnly: true
      required:
        - customer_information
        - effective_from
        - effective_through
        - insurer
        - policy_status
        - premium
        - product_information
        - renewal_information
    ActivationMetadata:
      type: object
      properties:
        renew:
          type: boolean
          description: Set this insurance policy to auto-renew
        send_customer_notification:
          type: boolean
          writeOnly: true
          default: false
  securitySchemes:
    ClientKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````