Backend API
Create a new customer account credit.
Arguments
Account credit value. Must be greater than zero.
Unique identifier for the parent account.
Unique identifier for the account credit.
Automatically generated field that gets incremented each time an account credit is created.
Expandable list of account credits.
ID of the credit applied to the customer's account.
Three-letter ISO currency code in uppercase. Defaults to the store's base currency.
Date and time the credit was created.
Date and time the credit was last updated.
ID of the gift card used to make the payment, if applicable.
Expandable link to the invoice the credit was applied to, if applicable.
ID of the invoice the credit was applied to, if applicable.
Expandable link to the parent account.
Expandable link to the payment.
Unique identifier for the payment.
The reason for the refund.
A brief message describing the reason for the refund.
Expandable list of refunds that apply to the credit.
ID of the refund the credit was applied to.
const { swell } = require('swell-node');
swell.init('store-id', 'secret-key');
await swell.post('/accounts:credits', {
parent_id: '621e53a6213eaf013d1fa6b2',
amount: 17,
reason: 'refund'
});Response
{
"parent_id": "621e53a6213eaf013d1fa6b2",
"amount": 17,
"reason": "refund",
"currency": "USD",
"date_created": "2022-07-08T20:27:40.199Z",
"number": "100003",
"id": "62c8933c5f4ffe00136039f2"
}