Skip to main content
This guide walks you through processing your first payment with PayGood. By the end, you will have created a customer, registered a payment instrument, and completed a charge.
You need an API key before following this guide. See Set Up Your API Keys to generate one.
1

Create a customer

Every payment must be linked to a customer. Send a POST /merchants/{merchantId}/customers request with the customer’s entityType (individual or organization) and name fields.
Save the customerId from the response, you’ll need it in the next steps.
2

Register a payment instrument

A payment instrument is a tokenized card or bank account linked to your customer. Tokenize the raw card data with our collect component first, then pass the resulting token to PayGood. Some server-side setup is required to initialize the component - see core package / React package docs
Save the paymentInstrumentId from the response.
3

Create a price (recommended)

Define a reusable price in your catalog so you can reference it on payments without hard-coding amounts each time.
Save the priceId from the response.
4

Create a payment

You have everything you need. Submit the payment using the IDs you collected in the previous steps.Set captureMethod to automatic to authorize and capture the funds in a single step, which charges the customer immediately.
A successful response returns the payment record with status: "captured".

Payment statuses

After creation, a payment moves through a lifecycle of statuses. Use these to track the state of every charge.
Always use a unique idempotencyKey per payment to safely retry failed requests without double-charging. If a network error occurs, resubmit the same request with the same key — PayGood returns the original result instead of creating a duplicate.