To take payments through the API, you add your payment service provider (PSP) to your GoMeddo Payments account. You create the API keys in your PSP account first, and then send them to GoMeddo Payments with the Create Payment Provider endpoint.
Before you start: you need an access token and your account id, see Authenticating. You also need the API keys of your PSP account. For Stripe, see Configure Stripe. For an overview of the API, see GoMeddo Payments API only.
Add the payment provider
Call the Create Payment Provider endpoint, POST /v1/account/{accountId}/providers, with a body like this:
{
"name": "Stripe main account",
"provider": "STRIPE",
"credentials": {
"api_key": "<your-restricted-key>"
}
}
|
Field Name |
Required |
Description |
|---|---|---|
|
|
Yes |
A name for the provider, so you can tell your providers apart. |
|
|
Yes |
The PSP, for example |
|
|
Yes |
The API keys from your PSP account. Which keys you need depends on the PSP, see the table below. |
The credentials object takes these keys:
|
Provider |
Credentials |
|---|---|
|
|
|
|
|
|
GoMeddo Payments checks the credentials with the PSP and stores them in a secret store, not in its database. For Stripe and Adyen, it then creates the webhook in your PSP account, so payment updates reach GoMeddo Payments without further setup.
The response returns the new provider with its provider_id. You use the provider_id in later calls, for example to start a transaction.
When the call fails
GoMeddo Payments doesn't create the provider when:
-
It returns
400withInvalid credentials: the PSP rejected the API keys. -
It returns
400with field errors: a required field is missing, orproviderhas a value GoMeddo Payments doesn't support. -
It returns
422: GoMeddo Payments could not create the webhook in your PSP account. The message tells you why.
API documentation
The full API documentation lists every endpoint and its parameters: