Skip to content
myela

How test keys, test cards, and the sandbox host work, and which parts need your account.

The sandbox is a separate copy of the Myela API for building and testing. It takes test keys only, and the keys, test cards, and try-it runner that go with it are tied to your account.

Send every test request to https://payments-api-sandbox.merchantservicedepot.com. The sandbox accepts test keys only, and a test key is unknown in production. The SDK has no default host, so set it yourself:

MYELA_API_KEY=myela_sk_test_…
MYELA_API_BASE_URL=https://payments-api-sandbox.merchantservicedepot.com
MYELA_SIGNING_SECRET=myela_sign_…

Test keys are self-serve for the account owner. Sign in to your Myela account, open Settings, then API keys, and issue a key. Myela emails you a six-digit code. Enter it and the key is created. A signed-in session alone isn’t enough to create a key that can charge cards, and revoking a key asks for a code the same way.

  • Give the key a name, and optionally up to 20 browser origins for its publishable half.
  • The secret key is shown once. Myela keeps only a hash, so store it before you leave the page. The publishable key stays visible in the same place.
  • Keys you issue are always test keys, with the standard set of operations. That set covers everything except deleting customers, payment methods, and addresses, and creating credits. You can’t change it yourself.
  • Keys you issue don’t require request signing. To rehearse signing before you go live, ask Myela for a test key that requires it. See Authentication and request signing.

Test cards are per account. Which cards approve, which decline, and how you trigger each outcome depends on how your account is set up, so they aren’t published here. Sign in to your Myela account to see your account’s test cards.

When you’re signed in as the account owner, the try-it runner sends requests to the sandbox for you. It uses one of your own unrevoked test keys, chosen by its record in your account, so your secret key never passes through the browser. It runs against the sandbox only.

Some requests are documented but can’t be run there: anything that carries a paymentToken (creating a payment, a credit, or a payment method from a token), and creating or updating a webhook endpoint. A payment that uses a saved paymentMethodId can be run.

GET /v1/capabilities needs no particular permission, so it makes a good first call. It returns every operation with a status.

curl https://payments-api-sandbox.merchantservicedepot.com/v1/capabilities \
  -H "Authorization: Bearer myela_sk_test_…"
status Means You can
active The key can call it now. Call it.
unavailable The key isn’t entitled to it. A call returns 403 capability_not_enabled. Ask Myela to enable it.
unsupported Not available on this account, permanently. A call returns 501 capability_not_supported. Design it out.

POST /v1/invoices/scheduler/run collects your account’s due invoices now. It needs the invoices.schedule permission. Outside the sandbox it returns 403 permission_denied with details.code set to SANDBOX_ONLY.

Automatic invoice collection doesn’t run on every environment. When you schedule an invoice where it isn’t running, the response includes a warning with the code INVOICE_SCHEDULER_DISABLED, and the invoice won’t be charged on its own. In the sandbox, call scheduler/run to collect it. More in Invoices.