> ## 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 applications

> List the applications your customers submit, approve them, and optionally export the customer to Shopify in the same request.

List the applications your customers submit, and approve them. An application is `pending` until you approve it, then `approved`. Archived customers don't appear.

Approving can also set the customer's net terms and export the customer to Shopify, in one request.

## Exporting to Shopify

Send `export.shopify` with `as`:

* `customer` creates a Shopify customer, or links the one in `shopify_customer_id`.
* `company` adds the applicant as a contact of a Shopify B2B company. The store needs B2B turned on.

A Shopify company is a customer group in Streamlined. With `as: company`, the group and company are chosen like this:

| You send | Group | Shopify company |
| - | - | - |
| Neither `customer_group_uuid` nor `shopify_company_id` | New | New |
| `customer_group_uuid` | That group | The group's company, or a new one if it has none |
| `shopify_company_id` | The group linked to that company, or a new one | That company |
| Both | That group | That company |

A new company gets one location with the applicant's addresses, tax exemption and net terms, and the applicant becomes its main contact. If the store has no matching payment terms, the company is created without terms and you get the `net_terms_unsupported_in_shopify` warning.

Joining an existing company adds the applicant at one location and changes nothing else on the company. If the company has more than one location, send `shopify_company_location_id`.

## Errors

If the approval succeeded but the export failed, the error includes `"approved": true`. Don't approve again; retry the export as described below.

| Code | Meaning |
| - | - |
| `invalid_request` | A parameter is malformed, or a company parameter was sent with `as: customer`. |
| `application_not_pending` | The application isn't pending. |
| `customer_group_not_found` | `customer_group_uuid` isn't one of your groups. |
| `no_shopify_connection` | No connected store matches `shop_domain`. |
| `shopify_b2b_unavailable` | The store doesn't have B2B. |
| `shopify_company_not_found` | The Shopify company doesn't exist in the store. |
| `shopify_company_group_conflict` | The Shopify company belongs to a different group. The message names it. |
| `customer_in_other_group` | The customer is already in a different group. |
| `customer_linked_to_other_shop` | The customer is linked to a different Shopify store. |
| `shopify_location_required` | The company has several locations. Send `shopify_company_location_id`. |
| `shopify_location_not_found` | That location isn't on the company, or the export is creating a new company. |
| `shopify_customer_already_linked` | Another of your customers is linked to that Shopify customer. |
| `shopify_contact_in_other_company` | The Shopify customer is a contact of a different company. |
| `shopify_customer_invalid` | Shopify rejected the customer, for example an invalid email. |
| `shopify_company_create_failed` | Shopify rejected the company. |
| `shopify_export_failed` | Something unexpected went wrong. Returned as `502`. Retry. |

## Retrying an export

Call approve again with the same `export.shopify` and no `net_terms`. Only the export runs, and it reuses the group and company from the first attempt, so it never creates duplicates.


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