Get payment methods
This article will guide you through how to retrieve payment methods. The Postman collection will be used for all examples.
Prerequisites
accessToken
from Connect flow.countryId
from Get countries.cultureCode
, e.g.en-US
Optional query parameters
priceGroupId
- limits the display to payments methods available for this price group - can be obtained from the Get price groups step.maxItems
- limits the number of payment methods returned. The list is paginated.nextPagingToken
- required to fetch the next page. The token is described in detail in the Next Paging Token article.
Get Payment Methods
Open the Get Payment Methods
request.
Provide the mandatory query parameters - countryId
and cultureCode
. Optional query parameters can be added as well.
Request:
curl -D- -X POST {base_url}/api/v1/payment-methods?countryId={countryId}&cultureCode={cultureCode}&priceGroupId={priceGroupId}&maxItems={maxItems}&nextPagingToken={nextPagingToken} \ -H 'Authorization: Bearer <ACCESS_TOKEN>' -H 'Content-Type: application/json'
Response:
{ "nextPagingToken": "{nextPagingToken | null}", "paymentMethods": [ { "description": "{description}", "displayName": "{displayName}", "feePercent": "{feePercent}", "fees": [ { "amount": "{amount}", "priceGroupId": "{priceGroupId}" } ], "id": "{id}", "imageUrl": "{imageUrl}", "name": "{paymentName}" }, { "displayName": "{displayName}", "feePercent": "{feePercent}", "fees": [ { "amount": "{amount}", "priceGroupId": "{priceGroupId}" } ], "id": "{id}", "imageId": "{imageId}", "imageUrl": "{imageUrl}", "name": "{name}" } ] }
Possible errors that may occur:
Error | Description |
---|---|
BadRequest (400) | PriceGroup does not exist; Country does not exist; etc. |
Unauthorized (401) | The token is expired. |
Forbidden (403) | The token does not have access to this endpoint. |
{ "errors": [ { "error-description": "PriceGroup does not exist.", "error": "BadRequest" } ] }
See Handling failures for more info.