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

# Approve customer application

> Approves a pending application, and optionally sets the customer's net terms and exports the customer to Shopify. Returns the customer, plus the export result if you sent `export.shopify`.



## OpenAPI

````yaml /api-reference/openapi.yaml post /customer_applications/{uuid}/approve
openapi: 3.0.3
info:
  title: Streamlined API
  description: >
    Access customers, customer applications, customer groups, products, payouts,
    invoices, transactions, and deposit links programmatically through this API,
    and receive webhooks when deposit links change. All requests must be
    authenticated with an API key.
  version: 1.6.0
  license:
    name: Proprietary
    url: https://streamlinedpayments.com/terms
servers:
  - url: https://api.staging.streamlinedpayments.com/api/v1
    description: Sandbox
  - url: https://api.streamlinedpayments.com/api/v1
    description: Production
security:
  - AppIdAuth: []
    ApiKeyAuth: []
tags:
  - name: Customers
    description: Create, update and delete the businesses you sell to.
  - name: Customer applications
    description: >-
      List the applications your customers submit, and approve them. Approving
      can also set net terms and export the customer to Shopify. See [Approve
      customer applications](/guides/customer-applications).
  - name: Customer groups
    description: >-
      Organize customers into groups and manage who's in each one. A group can
      be linked to a Shopify B2B company.
  - name: Customer files
    description: Upload and manage files attached to a customer.
  - name: Customer addresses
    description: Manage a customer's addresses and choose their default billing address.
  - name: Orders
    description: Create orders, add and remove line items, and schedule them.
  - name: Invoices
    description: Create invoices from orders, then list, look up and update them.
  - name: Transactions
    description: List transactions and look one up.
  - name: Payouts
    description: List payouts, including pending ones, and look one up.
  - name: Products
    description: >-
      Create and update the products and services you sell, import them in bulk,
      and merge duplicates.
  - name: Deposit links
    description: Collect money from a customer before an invoice exists.
  - name: Webhooks
    description: >-
      Register HTTPS endpoints to receive events when something changes. See
      [Webhooks](/guides/webhooks) for signatures, retries and delivery
      guarantees.
paths:
  /customer_applications/{uuid}/approve:
    post:
      tags:
        - Customer applications
      summary: Approve customer application
      description: >-
        Approves a pending application, and optionally sets the customer's net
        terms and exports the customer to Shopify. Returns the customer, plus
        the export result if you sent `export.shopify`.
      operationId: approveCustomerApplication
      parameters:
        - name: uuid
          in: path
          description: The customer's UUID.
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApproveCustomerApplicationRequest'
            examples:
              NewCompany:
                summary: Approve on Net 30 and create a Shopify company
                value:
                  net_terms: 30
                  export:
                    shopify:
                      shop_domain: acme
                      as: company
              JoinCompany:
                summary: Add to an existing group's company at one location
                value:
                  export:
                    shopify:
                      shop_domain: acme
                      as: company
                      customer_group_uuid: 0c6d2f58-3f0e-4c0a-9d44-2b8d5c1f7a10
                      shopify_company_location_id: '456'
      responses:
        '200':
          description: Approved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerApplicationApproval'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          description: >-
            Refused, or the export failed after approving. See [error
            codes](/guides/customer-applications#errors).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerApplicationError'
              example:
                errors:
                  - >-
                    Shopify company gid://shopify/Company/99 has several
                    locations; pick one: 45th Street
                    (gid://shopify/CompanyLocation/456), 23rd Street
                    (gid://shopify/CompanyLocation/457)
                code: shopify_location_required
                approved: true
        '502':
          description: The export failed unexpectedly after approving. Retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerApplicationError'
              example:
                errors:
                  - Approved, but the Shopify export failed. Try again.
                code: shopify_export_failed
                approved: true
components:
  schemas:
    ApproveCustomerApplicationRequest:
      type: object
      properties:
        net_terms:
          type: integer
          nullable: true
          enum:
            - 0
            - 7
            - 10
            - 15
            - 30
            - 45
            - 60
            - 90
          description: >-
            Days. `0` is due on receipt, `null` uses your default. Omit to keep
            the current terms.
        export:
          type: object
          properties:
            shopify:
              type: object
              description: Export the customer to Shopify after approving.
              required:
                - shop_domain
              properties:
                shop_domain:
                  type: string
                  description: The connected store, as `acme` or `acme.myshopify.com`.
                as:
                  type: string
                  enum:
                    - customer
                    - company
                  default: customer
                shopify_customer_id:
                  type: string
                  description: >-
                    An existing Shopify customer to link instead of creating
                    one. With `as` set to `company`, it becomes the company
                    contact.
                customer_group_uuid:
                  type: string
                  format: uuid
                  description: >-
                    Only with `as` set to `company`. The group to add the
                    applicant to.
                shopify_company_id:
                  type: string
                  description: >-
                    Only with `as` set to `company`. An existing Shopify company
                    to link.
                shopify_company_location_id:
                  type: string
                  description: >-
                    Only with `as` set to `company`. The location to add the
                    applicant at, when the company has more than one.
    CustomerApplicationApproval:
      allOf:
        - $ref: '#/components/schemas/CustomerDetail'
        - type: object
          properties:
            export:
              $ref: '#/components/schemas/CustomerApplicationExport'
    CustomerApplicationError:
      type: object
      properties:
        errors:
          type: array
          items:
            type: string
        code:
          type: string
        approved:
          type: boolean
          description: True when the application is approved despite the error.
    CustomerDetail:
      type: object
      properties:
        customer:
          type: object
          properties:
            website:
              type: string
            company_name:
              type: string
            created_at:
              type: string
              format: date-time
            updated_at:
              type: string
              format: date-time
            tags:
              type: array
              items:
                type: string
            first_name:
              type: string
            last_name:
              type: string
            uuid:
              type: string
              format: uuid
            display_name:
              type: string
            customer_email:
              type: string
            total_open_balance_amount:
              type: integer
            quick_pay_enabled:
              type: boolean
            average_days_to_pay:
              type: integer
            net_terms:
              type: integer
              nullable: true
              enum:
                - 0
                - 7
                - 10
                - 15
                - 30
                - 45
                - 60
                - 90
              description: >-
                Payment terms in days. null means inherit from customer group,
                then merchant default.
            net_terms_label:
              type: string
              nullable: true
              description: >-
                Human-readable label for net_terms (e.g. "Net 30", "Due on
                receipt").
            shopify_customer_id:
              type: string
              nullable: true
              description: >-
                The Shopify customer this customer is linked to, as a GID. null
                if not linked.
              example: gid://shopify/Customer/1234567890
            shopify_shop_domain:
              type: string
              nullable: true
              description: >-
                The Shopify store the linked Shopify customer belongs to. null
                if not linked.
              example: your-store
            application_submitted_at:
              type: string
              format: date-time
              nullable: true
              description: null if the customer never applied.
            application_approved_at:
              type: string
              format: date-time
              nullable: true
              description: null until the application is approved.
            customer_group:
              type: object
              nullable: true
              description: The group this customer belongs to, if any.
              properties:
                uuid:
                  type: string
                  format: uuid
                company_name:
                  type: string
            billing_address:
              $ref: '#/components/schemas/Address'
            addresses:
              type: array
              items:
                $ref: '#/components/schemas/Address'
    CustomerApplicationExport:
      type: object
      description: >-
        Present when you sent `export.shopify`. Shopify IDs are GIDs. The
        company fields are null with `as` set to `customer`.
      properties:
        shopify_company_id:
          type: string
          nullable: true
          example: gid://shopify/Company/99
        shopify_company_url:
          type: string
          nullable: true
          example: https://admin.shopify.com/store/acme/companies/99
        shopify_company_location_id:
          type: string
          nullable: true
          example: gid://shopify/CompanyLocation/456
        customer_group_uuid:
          type: string
          format: uuid
          nullable: true
        warnings:
          type: array
          description: >-
            The export succeeded but needs your attention.
            `net_terms_unsupported_in_shopify` means the company was created
            without terms; `shopify_address_fields_dropped` means Shopify
            rejected the address phone or state, so it was left off.
          items:
            type: string
            enum:
              - net_terms_unsupported_in_shopify
              - shopify_address_fields_dropped
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
    Address:
      type: object
      properties:
        id:
          type: integer
        address1:
          type: string
        address2:
          type: string
        city:
          type: string
        state:
          type: string
        postal_code:
          type: string
        phone:
          type: string
        country:
          type: string
        email:
          type: string
        cc_email:
          type: string
          description: CC email addresses (comma-separated list)
        first_name:
          type: string
        last_name:
          type: string
        company_name:
          type: string
  responses:
    Unauthorized:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            AuthenticationRequired:
              value:
                error: Authentication required
                message: >-
                  API endpoint requires authentication. Please provide valid
                  X-App-Id and X-Api-Key headers.
            InvalidCredentials:
              value:
                error: Invalid credentials
                message: >-
                  The provided API credentials are invalid. Please check your
                  X-App-Id and X-Api-Key values.
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    AppIdAuth:
      type: apiKey
      in: header
      name: X-App-Id
      description: App ID for authentication
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: API Key for authentication

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.