POST
/
orders
/
order-number
/
{orderNumber}
/
actions
/
update-credit-status
curl --request POST \
  --url https://api.fabric.inc/v3/orders/order-number/{orderNumber}/actions/update-credit-status \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-fabric-channel-id: <x-fabric-channel-id>' \
  --header 'x-fabric-tenant-id: <x-fabric-tenant-id>' \
  --data '{
  "attributes": {
    "giftCardNumber": "XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ"
  },
  "creditId": "a05b72dc-78d8-4ea4-90fc-2fe6a1fe1111",
  "note": "Credit request initiated",
  "statusCode": "PENDING"
}'
{
  "amount": 21.5,
  "attributes": {
    "giftCardNumber": "XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ"
  },
  "createdAt": "2022-07-11T15:03:14.642Z",
  "creditId": "a05b72dc-78d8-4ea4-90fc-2fe6a1fe1111",
  "currency": "USD",
  "employeeId": "12312232",
  "note": "Credit request initiated",
  "paymentCounter": 1,
  "policyCode": "RC1",
  "reasonCode": "EC",
  "source": "CSR",
  "statusCode": "PENDING",
  "subReasonCode": "ACC",
  "type": "GIFT_CARD",
  "updatedAt": "2022-07-11T15:03:14.642Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-fabric-tenant-id
string
required

A header used by fabric to identify the tenant making the request. You must include tenant id in the authentication header for an API request to access any of fabric’s endpoints. You can retrieve the tenant id , which is also called account id, from Copilot. This header is required.

x-fabric-channel-id
string
required

x-fabric-channel-id identifies the sales channel where the API request is being made; primarily for multichannel use cases. The channel ids are 12 corresponding to US and 13 corresponding to Canada. The default channel id is 12. This field is required.

x-fabric-request-id
string

Unique request ID

Path Parameters

orderNumber
string
required

The merchant-defined order identifier provided during the Create Order - POST /orders endpoint.

Body

application/json

Request to update credits details

creditId
string
required

Unique UUID of credit

Example:

"a05b72dc-78d8-4ea4-90fc-2fe6a1fe1111"

statusCode
enum<string>
required

Credit status

Available options:
PENDING,
CONFIRMED,
FAILED,
CANCELED
Example:

"PENDING"

attributes
object

Merchant-defined custom attributes. This is a placeholder for additional info (in key: value pairs).

Example:
{
  "giftCardNumber": "XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ"
}
note
string

Placeholder for additional information, if any.

Example:

"Credit request initiated"

Response

200
application/json
OK

Credit response

amount
number
required

Credits amount

Example:

21.5

currency
string
required

Three-letter currency code as defined by ISO-4217

Example:

"USD"

reasonCode
string
required

Reason code

Example:

"EC"

source
string
required

Source of credits request

Example:

"CSR"

type
enum<string>
required

Credit type. Currently, supports only Gift Card

Available options:
GIFT_CARD
Example:

"GIFT_CARD"

attributes
object

Merchant-defined custom attributes. This is a placeholder for additional info in key: value pairs

Example:
{
  "giftCardNumber": "XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ"
}
createdAt
string

Credits creation time, in UTC format

Example:

"2022-07-11T15:03:14.642Z"

creditId
string

Unique UUID of credit

Example:

"a05b72dc-78d8-4ea4-90fc-2fe6a1fe1111"

employeeId
string

Employee (ID or name) who initiated a the credits request

Example:

"12312232"

note
string

Note

Example:

"Credit request initiated"

paymentCounter
integer

A sequential or incremental counter associated with a payment for an order. Applicable in refund scenarios to identify the specific payment for refund.

Example:

1

policyCode
string

Merchant-defined policy code, varies from merchant to merchant. If omitted, the default policy is used.

Example:

"RC1"

statusCode
enum<string>

Credit status

Available options:
PENDING,
CONFIRMED,
FAILED,
CANCELED
Example:

"PENDING"

subReasonCode
string

Subreason code

Example:

"ACC"

updatedAt
string

Time of last update to credits, in UTC format.

Example:

"2022-07-11T15:03:14.642Z"