# How to get set up to accept payments (https://developer.godaddy.com/en/docs/api-users/commerce/accept-payments/before-you-start)

---
title: How to get set up to accept payments
navLabel: Before you start
description: >-
  Set up the GoDaddy Payments account, store ID, and Personal Access Token that
  every online and in-person payment needs.
keywords: >-
  accept payments setup, GoDaddy Payments account, store ID, storeId, Personal
  Access Token, payment scopes, go live, checkout-session scope, payment-request
  scope
agentNotes:
  permissions:
    - GoDaddy Payments account on the business that owns the store
  scopes:
    - 'commerce.checkout-session:write'
    - 'commerce.payment-request:write'
    - 'commerce.payment-request:read'
    - 'commerce.store:read'
    - 'commerce.channel:read'
    - 'commerce.transaction:read'
    - 'commerce.store.apple-pay:write'
  idempotent: false
  destructive: false
  failureRecovery: >-
    Account and store setup happen in the GoDaddy interface, not through an API.
    A 401 or 403 on a later call means the token is missing a scope from the
    table on this page, or was created on an account that doesn't own the store.
    Create a new token with the scopes you call.
related:
  guides:
    - title: How to take your first payment
      href: /docs/api-users/commerce/accept-payments/first-payment
    - title: How to create a checkout session
      href: /docs/api-users/commerce/accept-payments/online-payments/create-session
    - title: How to charge a card on a terminal
      href: >-
        /docs/api-users/commerce/accept-payments/in-person-payments/charge-a-card
    - title: How to connect your terminal
      href: >-
        /docs/api-users/commerce/accept-payments/in-person-payments/connect-terminal
    - title: How to Authenticate
      href: /docs/api-users/auth/how-to
  concepts:
    - title: About accepting payments
      href: /docs/api-users/commerce/accept-payments
    - title: About the Commerce API
      href: /docs/api-users/commerce
pageId: a197bc05-1875-439d-9f2a-c1d8b517fd45
---

## Overview

Every online and in-person payment needs the same three things. You need a GoDaddy Payments account with an active store, your `storeId`, and a Personal Access Token (PAT) with the right scopes. You set them up once, and every page under Accept payments assumes you have them.

This page also lists what must be true before your software charges a paying customer.

## Create a GoDaddy Payments account

There's no API for this step. You create the GoDaddy Payments account and activate the store in the GoDaddy interface. This path uses a PAT on your own account, so there's no developer organization, OAuth client, or application registration to set up.

Go to [Set up a GoDaddy Payments account](https://www.godaddy.com/help/get-started-with-godaddy-payments-40721) to create your account and activate your store.

Without the GoDaddy Payments account, you can still create a session, but the payment fails.

## Find your store ID

Every payment names the store it belongs to with `storeId`.

Sign in to your GoDaddy account and go to [About the Commerce API](https://developer.godaddy.com/docs/api-users/commerce#your-stores) to retrieve your `storeId`.

## Create a Personal Access Token

A PAT authenticates your server. Create it on the account that owns the store, and select only the scopes for the calls you intend to make.

The following table lists the scopes each task needs:

| Task                                            | Scopes                                                            |
| ----------------------------------------------- | ----------------------------------------------------------------- |
| Create checkout sessions                        | `commerce.checkout-session:write`                                 |
| Charge a card on a terminal and read the result | `commerce.payment-request:write`, `commerce.payment-request:read` |
| List the terminals on a store                   | `commerce.store:read`                                             |
| Read a store's sales channels                   | `commerce.channel:read`                                           |
| Read transactions                               | `commerce.transaction:read`                                       |
| Register a domain for Apple Pay                 | `commerce.store.apple-pay:write`, `commerce.store:read`           |

Go to [How to Authenticate](https://developer.godaddy.com/docs/api-users/auth/how-to) to create the token.

The token displays once, so store it in a secrets manager. The browser never needs it. For online payments, the checkout session carries a token of its own, and that's what the checkout form authenticates with.

## Set the environment variables

The examples under Accept payments read the following values from the environment:

| Variable             | Value                                                                   | Used by                                             |
| -------------------- | ----------------------------------------------------------------------- | --------------------------------------------------- |
| `GODADDY_PAT`        | Your Personal Access Token                                              | Every example                                       |
| `STORE_ID`           | Your `storeId`                                                          | Every example                                       |
| `SKU_ID`             | A SKU in your catalog                                                   | Online examples that charge an existing SKU         |
| `DRAFT_ORDER_ID`     | A draft order you created                                               | Online examples that charge an existing draft order |
| `TRANSACTION_ID`     | A transaction ID from a completed payment                               | Transaction lookup examples                         |
| `DEVICE_ID`          | The terminal's device identifier                                        | In-person examples                                  |
| `SERIAL_NUMBER`      | The serial number printed on your terminal                              | In-person examples that find a `deviceId`           |
| `PAYMENT_REQUEST_ID` | A UUID you generate for a new charge, or the ID of the request you poll | In-person examples                                  |
| `REFERENCE_ID`       | Your own order or ticket number                                         | In-person examples that set `references`            |
| `CALLBACK_URL`       | The public HTTPS URL that receives payment request callbacks            | In-person examples                                  |
| `WEBHOOK_SECRET`     | The shared secret GoDaddy signs callbacks with                          | In-person examples                                  |
| `UPDATED_AT_AFTER`   | An RFC 3339 date-time, like the start of an outage                      | In-person examples that list payment requests       |

Go to [How to connect your terminal](https://developer.godaddy.com/docs/api-users/commerce/accept-payments/in-person-payments/connect-terminal) to find a terminal's `DEVICE_ID`.

## Before you take live payments

You must meet the following prerequisites before your software charges a paying customer:

* a GoDaddy Payments account
* an active store on that account
* a PAT with the scopes for every call you make
* for in-person payments, a GoDaddy terminal (Duo, Flex, or Pro) purchased for the account

  Go to [GoDaddy Payments point of sale](https://www.godaddy.com/payments/point-of-sale) to choose and buy a terminal.
* for Apple Pay online, every checkout domain registered

  Go to [How to set up Apple Pay](https://developer.godaddy.com/docs/api-users/commerce/accept-payments/online-payments/apple-pay) to register your domains.

Tax is optional and configured on the store. Go to [Create and apply taxes](https://www.godaddy.com/help/create-and-apply-taxes-40780) to set it up in the GoDaddy interface, or [How to configure your taxes](https://developer.godaddy.com/docs/api-users/commerce/configure-taxes) to set it up through the API.
