1. Signing the shopper back in
Login is a secret-key call on your server; a publishable key returns403. It returns the customer
record and a session whose access_token is the shopper’s session token, which goes back to the
browser as xAuthToken for the customer-self calls below.
Response
2. Order history
Order history is a secret-key read on your server.listOrders returns the customer’s orders
newest-first, filtered by payment_status or paged with the cursor. A publishable key returns 403
here, so order data never leaves your server.
Response
getOrder returns one order with its line items:
Response
3. The customer’s profile
The shopper reads their own profile with the publishable client plus their session token.getCustomer requires the {id} to match the resolved session, and a mismatch returns 403, so a
shopper can only ever read their own record. address, last_purchase, and store_metrics are
nullable; tier is the loyalty tier.
Response
Stores that run their own identity provider (Auth0, Clerk, Cognito, Firebase, NextAuth, SSO) pass a
signed
xExternalAuth assertion instead of xAuthToken — the same customer-self endpoints accept
either. See Authentication for the assertion format.4. Lodging a return
createReturn (publishable client plus session token) returns part or all of a delivered order. It
takes a reason_code from the public reason list, a return_type, and the order lines being sent
back, and the return lands in pending for the merchant to review.
The reason codes that populate the form need no session:
Response
Response
Returns must be enabled for the store. If the merchant has them turned off,
createReturn returns
422 with { error: { code: "returns_disabled" } }. Approving a return and reviewing the items is
a merchant action done in admin — not via this API.5. Tracking the return
listReturns gives the shopper all of their own returns and getReturn one by id, both on the
publishable client plus session token.
Response
6. The resolution branches: store credit or a refund
Reviewing the return, the merchant can offer store credit instead of a cash refund. The return’scredit_offer.status flips to offered/pending with an amount, and the shopper takes one of two
paths from there. Both run on the publishable client plus session token.
The balance before any resolution — a shopper who has never been credited has nothing yet:
Response
currency is null here, and stays null even after credit is issued: the store-credit ledger
does not stamp a currency code, because the balance is always in the store’s own currency.
balance is the amount.Path A — accepting the store credit
acceptReturnCredit takes the credit. Galactic Core issues it to the shopper’s balance and returns
the new credit record.
Response
currency still null:
Response
Path B — declining the credit for a cash refund
A shopper who would rather have their money back declines the offer withrequestReturnRefund. The
return moves to refund_requested and the merchant handles the payout outside this API. The call is
valid only while a store-credit offer is pending, and returns 409 otherwise.
Response
The two paths are mutually exclusive on the same offer: the shopper takes either the credit
(Path A) or the refund (Path B), never both. The step below follows Path A, where the shopper kept
the $24.95 credit.
7. Spending the credit on the next order
At the shopper’s next checkout,apply_store_credit: true on the order body applies the $24.95 kept
in Path A, optionally capped with store_credit_amount. The amount actually applied comes back as
store_credit_applied. Order creation is a secret-key, HMAC-signed call, so this runs on your server
— Storefront checkout has the
signing recipe.
Response
store_credit_applied is the amount of the customer’s balance Galactic Core spent against this
order, here the $24.95 kept in Path A. Where the credit fully covers the order, Galactic Core also
reflects it in the order’s discount_amount and stamps the order notes with
[STORE_CREDIT_APPLIED <amount>].What’s next
- Search & discovery covers search, recommendations, and dynamic pricing for the next purchase.
- Storefront checkout walks the full guest-to-paid path for a new shopper.
- Reviews and support threads follow once the return resolves.

