Skip to main content

Payment Accounts API (0)

Download OpenAPI specification:Download

This association is done by assigning the same ID to the payment account and the entity it is linked to.

Payments

Represents a payment account used during order placement. It has a balance and stores the transactions and the financial instruments that modified its balance.

Use this resource to retrieve information about a payment account. A payment account can also be used to track the balance and transactions of other entities created by the NewStore platform. For example, a payment account can be associated with an entity such as a sales order, a customer, or a shopping bag by assigning the same ID to the payment account and to the entity.

Note - Currently, NewStore only supports assigning the same ID to a payment account and the related sales order.

Get Payments

Returns a snapshot of the account at the time of the request. The account balance that you retrieve is positive (> 0) whenever payments are authorized, but not captured yet. For example, when items are still waiting for fulfillment. If the account balance is negative, you might have over-captured the order, which means that you have captured an amount bigger than the requested amount.

Authorizations:
newStoreAccessToken
path Parameters
account_id
required
string (account ID)

Unique ID of a payment account. It is the same ID as the entity the payment account is assigned to. For example, use the internal ID (uuid) of a sales order.

Responses

Response samples

Content type
application/json
{
  • "balance": 0,
  • "transactions": [
    ],
  • "instruments": [
    ]
}

Get summary of a payment account

Returns the summary of the account history.

Authorizations:
newStoreAccessToken
path Parameters
account_id
required
string (account ID)

Unique ID of a payment account. It is the same ID as the entity the payment account is assigned to. For example, use the internal ID (uuid) of a sales order.

query Parameters
linked_accounts
string

Additional payment account identifier that should be aggregated in the response body.

Responses

Response samples

Content type
application/json
{
  • "payments": [
    ]
}

Precalculate the payment instruments for a future refund

Returns a list of payment instruments and amounts for a future refund, given the account state and refund amount.

Authorizations:
newStoreAccessToken
path Parameters
account_id
required
string (account ID)

Unique ID of a payment account. It is the same ID as the entity the payment account is assigned to. For example, use the internal ID (uuid) of a sales order.

Request Body schema: application/json
amount
required
number >= 0

A positive amount to be refunded

currency
required
string = 3 characters
strategy
string [ 0 .. 100 ] characters

The strategy to apply when processing the request. If no strategy is specified the default configured strategy is used.

Responses

Request samples

Content type
application/json
{
  • "amount": 10.05,
  • "currency": "USD"
}

Response samples

Content type
application/json
{
  • "instruments": [
    ]
}

Historical import

Store payment data for a historical order.

Authorizations:
newStoreAccessToken
Request Body schema: application/json
external_order_id
required
string [ 1 .. 64 ] characters

(Previously: external_id) External order ID visible in NOM.

account_id
required
string = 36 characters

(Previously: sales_order_uuid) The account that this payment belongs to, usually sales_order_uuid

placed_at
required
string <date-time>

Date representation of when the order was placed, containing date, time and timezone as defined by https://tools.ietf.org/html/rfc3339 (ISO 8601).

store_id
required
string <= 256 characters

ID of the store where this order was placed.

currency
required
string
Enum: "AED" "AFN" "ALL" "AMD" "ANG" "AOA" "ARS" "AUD" "AWG" "AZN" "BAM" "BBD" "BDT" "BGN" "BHD" "BIF" "BMD" "BND" "BOB" "BOV" "BRL" "BSD" "BTN" "BWP" "BYN" "BZD" "CAD" "CDF" "CHE" "CHF" "CHW" "CLF" "CLP" "CNY" "COP" "COU" "CRC" "CUC" "CUP" "CVE" "CZK" "DJF" "DKK" "DOP" "DZD" "EGP" "ERN" "ETB" "EUR" "FJD" "FKP" "GBP" "GEL" "GHS" "GIP" "GMD" "GNF" "GTQ" "GYD" "HKD" "HNL" "HRK" "HTG" "HUF" "IDR" "ILS" "INR" "IQD" "IRR" "ISK" "JMD" "JOD" "JPY" "KES" "KGS" "KHR" "KMF" "KPW" "KRW" "KWD" "KYD" "KZT" "LAK" "LBP" "LKR" "LRD" "LSL" "LYD" "MAD" "MDL" "MGA" "MKD" "MMK" "MNT" "MOP" "MRU" "MUR" "MVR" "MWK" "MXN" "MXV" "MYR" "MZN" "NAD" "NGN" "NIO" "NOK" "NPR" "NZD" "OMR" "PAB" "PEN" "PGK" "PHP" "PKR" "PLN" "PYG" "QAR" "RON" "RSD" "RUB" "RWF" "SAR" "SBD" "SCR" "SDG" "SEK" "SGD" "SHP" "SLL" "SOS" "SRD" "SSP" "STN" "SVC" "SYP" "SZL" "THB" "TJS" "TMT" "TND" "TOP" "TRY" "TTD" "TWD" "TZS" "UAH" "UGX" "USD" "USN" "UYI" "UYU" "UYW" "UZS" "VES" "VND" "VUV" "WST" "XAF" "XAG" "XAU" "XBA" "XBB" "XBC" "XBD" "XCD" "XDR" "XOF" "XPD" "XPF" "XPT" "XSU" "XTS" "XUA" "XXX" "YER" "ZAR" "ZMW" "ZWL"

The currency for all the prices contained within this payload.

required
Array of objects <= 40 items

Responses

Request samples

Content type
application/json
{
  • "external_order_id": "HISTORIC_ORDER_123",
  • "account_id": "547cf43d-487a-4311-b630-346880725628",
  • "placed_at": "2018-10-08T07:06:08.067Z",
  • "store_id": "807b05a4-5554-5302-a67f-aa3293107e92",
  • "currency": "USD",
  • "payments": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "status": "string",
  • "request_id": "string"
}