Recurly Credit Payments API
The credit-payments API from Recurly — 3 operation(s) for credit-payments.
The credit-payments API from Recurly — 3 operation(s) for credit-payments.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/recurly:recurly-credit-payments-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Recurly V2 Credit Payments API
description: '# Getting Started
Welcome to the reference documentation for Recurly''s XML API v2. Here you will find a complete
reference for all API v2 operations. If you''re building a new product, or just getting started with Recurly, we recommend
using our newer JSON API v3. Now let''s get started with API v2. # Authentication
##### API Authentication (HTTP Basic)
Recurly uses HTTP Basic Authentication—your Private API key is securely encrypted by the SSL channel. If you are testing the API calls via the command line with cURL, try:
```
curl -H ''Accept: application/xml'' \
-H ''X-Api-Version: 2.29'' \
-H ''Content-Type: application/xml; charset=utf-8'' \
-u ''[apikey]'' \
https://[subdomain].recurly.com/v2/accounts
```
Replace `[apikey]` and `[subdomain]` with the appropriate values for your site. ##### Calculating your own authorization header
Most programming languages encode the authorization header automatically. With HTTP Basic Authentication, the `Authorization` header is a string containing a Base-64 encoded username and password. In the case of Recurly''s API, you need only specify the username as your API key. If your library requires a password, set it to an empty string. ```
"Authorization": "Basic " + base64_encode(API Key)
```
##### Additional Request Headers
**Accept Header**
Recurly API v2 returns results as XML. Your requests should always include the header requesting the results as XML:
```
Accept: application/xml
```
**Content-Type Header**
When sending data to Recurly in a POST or PUT request, your request must specify the content type of your request:
```
Content-Type: application/xml; charset=utf-8
```
**X-Api-Version Header**
When sending data to Recurly, your request should specify the API version you''re attempting to interact with:
```
X-Api-Version: 2.29
```
You learn more about the different versions in the API Versioning section. ##### Public API Key
Recurly uses two types of API keys: public and private. The Public API key is used by Recurly.js to identify its requests as belonging to your Recurly site. This key can be safely included in Javascript code. Recurly provides each site with one Public Key. The Public API Key can be regenerated on the API Credentials page. ##### Private API Keys
###### Treat your Private API Keys like passwords! The API key allows access to your site''s data. Do not include it in Javascript code exposed to browsers. Recurly supports the use of multiple Private API keys, which can be used to integrate third party services using unique, controlled credentials. **Limits & Pricing**
Merchants on the Starter or grandfathered Recurly plans or merchants in sandbox mode will be granted 5 private API keys. Merchants on Recurly''s Professional plan will be granted 10 private API keys. **Default Key**
Your default private API key should be used to integrate Recurly with your backend systems. There will be at least one key active at all times. **Additional Keys**
Additional private API keys should be used to connect your Recurly data to additional sources, like analytics software, accounting packages, or email tools. Recurly recommends clearly labeling the name of each key to identify the associated vendor. **Regenerating Private API Keys**
Your API key can be regenerated by clicking on the Regenerate button on the API credentials page. When you generate a private API key, you have two options:
1. Block the old key immediately. This is primarily recommended when the security of a key has been compromised. 2. Allow the old key access for 12 hours. This is primarily used when updating systems and a smooth transition between keys is needed. *If a private API key is changed, an email alert will be sent to your Recurly Site Technical Contact.*
**Read-Only Keys**
When creating a private key, you will have the option to set the key to “read-only”. This means the API key may make GET requests but cannot not PUT, POST or DELETE requests.'
version: '2.29'
servers:
- url: https://{subdomain}.{domain}/v2
variables:
subdomain:
description: Subdomain of your Recurly site.
default: my-super-successful-company
domain:
description: Domain of your Recurly site.
default: recurly.com
security:
- api_key: []
tags:
- name: credit-payments
x-displayName: Credit Payments
paths:
/credit_payments:
get:
summary: List Credit Payments
description: List all credit payments on the site.
tags:
- credit-payments
operationId: listCreditPayments
parameters:
- in: query
name: sort
schema:
type: string
default: created_at
description: 'The attribute that will be used to order records: `created_at`, `updated_at`.'
- in: query
name: order
schema:
type: string
default: desc
description: 'The order in which products will be returned: `asc` for ascending order, `desc` for descending order.'
- in: query
name: begin_time
schema:
type: string
format: date-time
default: ''
description: Operates on the attribute specified by the sort parameter. Filters records to only include those with datetimes greater than or equal to the supplied datetime. Accepts an ISO 8601 date or date and time.
- in: query
name: end_time
schema:
type: string
format: date-time
default: ''
description: Operates on the attribute specified by the sort parameter. Filters records to only include those with datetimes less than or equal to the supplied datetime. Accepts an ISO 8601 date or date and time.
- in: query
name: per_page
schema:
type: integer
default: '50'
description: Number of records to return per page, up to a maximum of 200.
- in: query
name: cursor
schema:
type: string
default: ''
description: Splits records across pages. Leave blank to return the first page. Follow the URI in the first page's Link header to fetch the next page.
responses:
'200':
description: ''
content:
application/xml:
example: "<credit_payments type=\"array\">\n <credit_payment href=\"https://api.recurly.com/v2/credit_payments/3d3f6754c6df41b9d2a32e43029adc55\" type=\"payment\">\n <account href=\"https://api.recurly.com/v2/accounts/3465345645345\"/>\n <uuid>3d3f6754c6df41b9d2a32e43029adc55</uuid>\n <action>payment</action>\n <currency>USD</currency>\n <amount_in_cents type=\"integer\">1000</amount_in_cents>\n <original_invoice href=\"https://api.recurly.com/v2/invoices/1000\"/>\n <applied_to_invoice href=\"https://api.recurly.com/v2/invoices/1001\"/>\n <created_at type=\"datetime\">2017-07-06T15:51:38Z</created_at>\n <updated_at type=\"datetime\">2017-07-06T15:51:38Z</updated_at>\n <voided_at type=\"datetime\">2017-07-22T15:51:38Z</voided_at>\n </credit_payment>\n <credit_payment href=\"https://api.recurly.com/v2/credit_payments/3e8764beb04add789fb3b54778838e17\" type=\"charge\">\n <account href=\"https://api.recurly.com/v2/accounts/3465345645345\"/>\n <uuid>3d3f6754c6df41b9d2a32e43029adc55</uuid>\n <action>refund</action>\n <currency>USD</currency>\n <amount_in_cents>1000</amount_in_cents>\n <original_invoice href=\"https://api.recurly.com/v2/invoices/1000\"/>\n <applied_to_invoice href=\"https://api.recurly.com/v2/invoices/1000\"/>\n <original_credit_payment href=\"https://api.recurly.com/v2/credit_payments/3d3f6754c6df41b9d2a32e43029adc55\"/>\n <refund_transaction href=\"https://api.recurly.com/v2/transactions/3e823e405e7f752988536947c08349ae\"/>\n <created_at type=\"datetime\">2017-07-06T15:51:38Z</created_at>\n <updated_at type=\"datetime\">2017-07-06T15:51:38Z</updated_at>\n <voided_at nil=\"nil\"></voided_at>\n </credit_payment>\n</credit_payments>"
x-codeSamples:
- lang: PHP
source: "<?php\n\n$credit_payments = Recurly_CreditPaymentList::get();\nforeach ($credit_payments as $payment) {\n print \"Credit Payment: $payment\\n\";\n}"
- lang: Ruby
source: "Recurly::CreditPayment.find_each do |payment|\n puts \"Credit Payment: #{payment}\"\nend"
- lang: Python
source: "for credit_payment in recurly.CreditPayment.all():\n print('Credit Payment: %s' % credit_payment)"
- lang: Dotnet
source: var creditPayments = CreditPayments.List(FilterCriteria.Instance.WithOrder(FilterCriteria.Order.Asc));
/credit_payments/{uuid}:
get:
summary: Lookup Credit Payment
description: Lookup a credit payment by uuid.
tags:
- credit-payments
operationId: lookupCreditPayment
parameters:
- in: path
name: uuid
schema:
type: string
default: ''
required: true
description: The uuid for the credit payment.
responses:
'200':
description: ''
content:
application/xml:
example: "<credit_payment href=\"https://api.recurly.com/v2/credit_payments/3e8764beb04add789fb3b54778838e17\" type=\"charge\">\n <account href=\"https://api.recurly.com/v2/accounts/3465345645345\"/>\n <uuid>3d3f6754c6df41b9d2a32e43029adc55</uuid>\n <action>refund</action>\n <currency>USD</currency>\n <amount_in_cents>1000</amount_in_cents>\n <original_invoice href=\"https://api.recurly.com/v2/invoices/1000\"/>\n <applied_to_invoice href=\"https://api.recurly.com/v2/invoices/1000\"/>\n <original_credit_payment href=\"https://api.recurly.com/v2/credit_payments/3d3f6754c6df41b9d2a32e43029adc55\"/>\n <refund_transaction href=\"https://api.recurly.com/v2/transactions/3e823e405e7f752988536947c08349ae\"/>\n <created_at type=\"datetime\">2017-07-06T15:51:38Z</created_at>\n <updated_at type=\"datetime\">2017-07-06T15:51:38Z</updated_at>\n <voided_at nil=\"nil\"></voided_at>\n </credit_payment>\n"
schema:
$ref: '#/components/schemas/CreditPayment'
x-codeSamples:
- lang: Ruby
source: "begin\n credit_payment = Recurly::CreditPayment.find '3e8764beb04add789fb3b54778838e17'\n puts \"Credit Payment: #{credit_payment.inspect}\"\nrescue Recurly::Resource::NotFound => e\n puts e.message\nend"
- lang: Python
source: "try:\n payment = recurly.CreditPayment.get('3e8764beb04add789fb3b54778838e17')\n print(\"Credit Payment: %s\" % payment)\nexcept recurly.NotFoundError:\n print(\"Credit Payment not found.\\n\")"
- lang: Dotnet
source: "try\n{\n var creditPayment = CreditPayments.Get(\"3e8764beb04add789fb3b54778838e17\");\n Console.WriteLine(\"Credit Payment \" + creditPayment);\n}\ncatch (NotFoundException e)\n{\n Console.WriteLine(\"CreditPayment not found.\");\n}"
/accounts/{account_code}/credit_payments:
get:
summary: List Credit Payments on Account
description: List credit payments associated with a specific account.
tags:
- credit-payments
operationId: listCreditPaymentsOnAccount
parameters:
- in: query
name: sort
schema:
type: string
default: created_at
description: 'The attribute that will be used to order records: `created_at`, `updated_at`.'
- in: query
name: order
schema:
type: string
default: desc
description: 'The order in which products will be returned: `asc` for ascending order, `desc` for descending order.'
- in: query
name: begin_time
schema:
type: string
format: date-time
default: ''
description: Operates on the attribute specified by the sort parameter. Filters records to only include those with datetimes greater than or equal to the supplied datetime. Accepts an ISO 8601 date or date and time.
- in: query
name: end_time
schema:
type: string
format: date-time
default: ''
description: Operates on the attribute specified by the sort parameter. Filters records to only include those with datetimes less than or equal to the supplied datetime. Accepts an ISO 8601 date or date and time.
- in: query
name: per_page
schema:
type: integer
default: '50'
description: Number of records to return per page, up to a maximum of 200.
- in: query
name: cursor
schema:
type: string
default: ''
description: Splits records across pages. Leave blank to return the first page. Follow the URI in the first page's Link header to fetch the next page.
- in: path
name: account_code
schema:
type: string
default: ''
required: true
description: The account's account_code.
responses:
'200':
description: ''
content:
application/xml:
example: "<credit_payments type=\"array\">\n <credit_payment href=\"https://api.recurly.com/v2/credit_payments/3d3f6754c6df41b9d2a32e43029adc55\" type=\"payment\">\n <account href=\"https://api.recurly.com/v2/accounts/3465345645345\"/>\n <uuid>3d3f6754c6df41b9d2a32e43029adc55</uuid>\n <action>payment</action>\n <currency>USD</currency>\n <amount_in_cents type=\"integer\">1000</amount_in_cents>\n <original_invoice href=\"https://api.recurly.com/v2/invoices/1000\"/>\n <applied_to_invoice href=\"https://api.recurly.com/v2/invoices/1001\"/>\n <created_at type=\"datetime\">2017-07-06T15:51:38Z</created_at>\n <updated_at type=\"datetime\">2017-07-06T15:51:38Z</updated_at>\n <voided_at type=\"datetime\">2017-07-22T15:51:38Z</voided_at>\n </credit_payment>\n <credit_payment href=\"https://api.recurly.com/v2/credit_payments/3e8764beb04add789fb3b54778838e17\" type=\"charge\">\n <account href=\"https://api.recurly.com/v2/accounts/3465345645345\"/>\n <uuid>3d3f6754c6df41b9d2a32e43029adc55</uuid>\n <action>refund</action>\n <currency>USD</currency>\n <amount_in_cents>1000</amount_in_cents>\n <original_invoice href=\"https://api.recurly.com/v2/invoices/1000\"/>\n <applied_to_invoice href=\"https://api.recurly.com/v2/invoices/1000\"/>\n <original_credit_payment href=\"https://api.recurly.com/v2/credit_payments/3d3f6754c6df41b9d2a32e43029adc55\"/>\n <refund_transaction href=\"https://api.recurly.com/v2/transactions/3e823e405e7f752988536947c08349ae\"/>\n <created_at type=\"datetime\">2017-07-06T15:51:38Z</created_at>\n <updated_at type=\"datetime\">2017-07-06T15:51:38Z</updated_at>\n <voided_at nil=\"nil\"></voided_at>\n </credit_payment>\n</credit_payments>"
x-codeSamples:
- lang: PHP
source: "<?php\n\n$credit_payments = Recurly_CreditPaymentList::getForAccount('1');\n\nforeach ($credit_payments as $payment) {\n print(\"$payment\\n\");\n}"
components:
schemas:
CreditPayment:
type: object
properties:
account:
type: string
description: The URL of the account for the credit payment.
uuid:
type: string
description: The unique identifier of the credit payment.
action:
type: string
description: 'The action the credit payment was created for. Is also a query param on the main list. Allowed Values: [payment, gift_card, refund, reduction, write_off].'
currency:
type: string
description: Currency, 3-letter ISO code.
amount_in_cents:
type: integer
description: Amount of the credit payment.
original_invoice:
type: string
description: The URL of the original invoice for the credit payment.
applied_to_invoice:
type: string
description: The URL of the invoice on which this payment was applied.
original_credit_payment:
type: string
description: The reference of the original credit payment being refunded. Only shown if action = 'refund'.
refund_transaction:
type: string
description: The reference of the refund transaction that matches the refund credit payment. Only shown if action = 'refund'.
created_at:
type: string
format: date-time
description: When the credit payment was created.
updated_at:
type: string
format: date-time
description: When the credit payment was created or updated. Will only update if voided.
voided_at:
type: string
format: date-time
description: When the credit payment was voided. Will only be voided if the credit payment was on a charge invoice that was then failed.
securitySchemes:
api_key:
type: http
description: Enter the API key as the username and set the password to an empty string. You can locate and manage your API keys from the [API Credentials](https://app.recurly.com/go/developer/api_keys) page.
scheme: basic