Backend API
Update an existing account credit using the ID that was returned when created.
Arguments
idobjectIdrequired
Unique identifier for the credit.
amountcurrencyrequired
Credit amount denominated in currency. Minimum of 0.01.
parent_idobjectIdrequired
The ID of the parent customer.
currencystring
Three-letter ISO currency code in uppercase. Defaults to the store's base currency.
credit_idobjectId
ID of the credit applied to the customer's account.
numberstringauto
Unique incremental number assigned automatically each time an account credit is created.
PUT/accounts:credits/:id
const { swell } = require('swell-node');
swell.init('store-id', 'secret-key');
await swell.put('/accounts:credits/{id}', {
id: '62c8933c5f4ffe00136039f2',
amount: 25
});
Response
{
"parent_id": "621e53a6213eaf013d1fa6b2",
"amount": 25,
"reason": "refund",
"currency": "USD",
"date_created": "2022-07-08T20:27:40.199Z",
"number": "100003",
"date_updated": "2022-07-12T16:02:14.965Z",
"id": "62c8933c5f4ffe00136039f2"
}