rewardApi: {
"/v1/reward": {
get: {
description: "Search for issued rewards.\n\nThis search capability supports the ability to nominate search criteria such as:\n\n- Date ranges\n- Pagination\n- Limits\n- Sorting";
querystring: TObject<
{
after: TOptional<TString>;
ascending: TOptional<TBoolean>;
before: TOptional<TString>;
category: TOptional<TString>;
limit: TOptional<TNumber>;
page: TOptional<TNumber>;
phone: TOptional<TString>;
transactionType: TOptional<TUnsafe<"CREDIT" | "DEBIT">>;
},
>;
response: {
"200": TObject<
{
data: TArray<
TObject<
{
amount: TObject<{ amount: ...; currency: ... }>;
category: TOptional<TString>;
createdAt: TString;
id: TString;
idempotencyKey: TString;
note: TOptional<TString>;
phone: TString;
transactionType: TUnsafe<(...) | (...)>;
},
>,
>;
hasNext: TBoolean;
pagination: TObject<{ limit: TNumber; page: TNumber }>;
},
>;
"400": TUnion<
[
TObject<{ code: TLiteral<"INVALID_PHONE">; message: TString }>,
TObject<{ code: TLiteral<"INVALID_ENTITY_TYPE">; message: TString }>,
TObject<{ code: TLiteral<"ENTITY_NOT_FOUND">; message: TString }>,
TObject<
{
code: TLiteral<"INVALID_REQUEST">;
errors: TOptional<TArray<TObject<(...)>>>;
message: TString;
},
>,
],
>;
};
summary: "Search Rewards";
tags: readonly ["Reward"];
};
post: {
body: TObject<
{
amount: TObject<{ amount: TNumber; currency: TLiteral<"MOVEUSD"> }>;
category: TOptional<TString>;
idempotencyKey: TString;
note: TOptional<TString>;
phone: TString;
transactionType: TUnsafe<"CREDIT" | "DEBIT">;
},
>;
description: "Create a reward for a specific CFX Identity.\n\nRewards are issued to a recipient through their phone number. Consequently Rewards can be issued to a recipient Identity prior to them registering within the CFX Network, which allows the creation of a Reward prior to recipient registration.\n\nRewards are managed within the CFX Platform as a ledger mechanism aligning with double entry account priciples. The issuance of a Reward to a recipient Identity results two matching entries:\n\n- A `CREDIT` entry of the `amount` against the recipient Identity account\n- A `DEBIT` entry of the `amount` against the reward issuer\n\nThe ledger allows the system to flexibily manage the growing Reward assets and liabilities for recipients and our CFX partners.\n\nWhen creating a reward the body must contain:\n\n- The `phone` of the recipient.\n- An `idempotencyKey` for the request, which is used to filter out duplicate reward issuances. Each invocation of the Create Reward endpoint should nominate a unique idempotency key.\n- A `category` for the reward, which is a free text field used to support client reporting and reconciliation.\n- A `transactionType` which indicates whether this is a `CREDIT` (add to reward balance) or `DEBIT` (reduce reward balance). Typically these will be `CREDIT` transactions.\n- A free text `note` to be associated with the Reward instance.";
response: {
"201": TObject<
{
amount: TObject<{ amount: TNumber; currency: TLiteral<"MOVEUSD"> }>;
category: TOptional<TString>;
createdAt: TString;
id: TString;
idempotencyKey: TString;
note: TOptional<TString>;
phone: TString;
transactionType: TUnsafe<"CREDIT" | "DEBIT">;
},
>;
"400": TUnion<
[
TObject<{ code: TLiteral<"INVALID_PHONE">; message: TString }>,
TObject<{ code: TLiteral<"INVALID_ENTITY_TYPE">; message: TString }>,
TObject<{ code: TLiteral<"ENTITY_NOT_FOUND">; message: TString }>,
TObject<{ code: TLiteral<"IDEMPOTENCY_ERROR">; message: TString }>,
TObject<{ code: TLiteral<"INVALID_AMOUNT">; message: TString }>,
TObject<
{
code: TLiteral<"INVALID_REQUEST">;
errors: TOptional<TArray<TObject<(...)>>>;
message: TString;
},
>,
],
>;
};
summary: "Create Reward";
tags: readonly ["Reward"];
};
};
"/v1/reward/{id}": {
get: {
description: "Retrieve a specific reward by nominating the Reward ID.";
params: TObject<{ id: TString }>;
response: {
"200": TObject<
{
amount: TObject<{ amount: TNumber; currency: TLiteral<"MOVEUSD"> }>;
category: TOptional<TString>;
createdAt: TString;
id: TString;
idempotencyKey: TString;
note: TOptional<TString>;
phone: TString;
transactionType: TUnsafe<"CREDIT" | "DEBIT">;
},
>;
"404": TObject<{ code: TLiteral<"NOT_FOUND">; message: TString }>;
};
summary: "Get Reward";
tags: readonly ["Reward"];
};
};
"/v1/reward/balance": {
get: {
description: "Retrieve the reward balance associated with a CFX customer. The balance illustrates the total financial exposure of the currently issued rewards.\n\nThe customer is not explicitly provided as input, but is instead mapped from the API credentials provided.";
querystring: TIntersect<
[
TObject<{ count: TOptional<TBoolean> }>,
TObject<{ inventory: TOptional<TBoolean> }>,
],
>;
response: {
"200": TIntersect<
[
TIntersect<
[
TObject<{ amount: TObject<(...)> }>,
TObject<
{ creditCount: TOptional<(...)>; debitCount: TOptional<(...)> },
>,
],
>,
TObject<
{ rewardInventoryWallet: TOptional<TIntersect<[(...), (...)]>> },
>,
],
>;
};
summary: "Get Customer Reward Balance";
tags: readonly ["Reward"];
};
};
"/v1/reward/balance/{phone}": {
get: {
description: "Retrieve the reward balance for a specific recipient Identity by nominating their phone number.";
params: TObject<{ phone: TString }>;
querystring: TObject<{ count: TOptional<TBoolean> }>;
response: {
"200": TIntersect<
[
TObject<
{
amount: TObject<{ amount: TNumber; currency: TLiteral<(...)> }>;
},
>,
TObject<
{
creditCount: TOptional<TNumber>;
debitCount: TOptional<TNumber>;
},
>,
],
>;
"400": TUnion<
[
TObject<{ code: TLiteral<"INVALID_PHONE">; message: TString }>,
TObject<{ code: TLiteral<"INVALID_ENTITY_TYPE">; message: TString }>,
TObject<{ code: TLiteral<"ENTITY_NOT_FOUND">; message: TString }>,
TObject<
{
code: TLiteral<"INVALID_REQUEST">;
errors: TOptional<TArray<TObject<(...)>>>;
message: TString;
},
>,
],
>;
};
summary: "Get Identity Reward Balance";
tags: readonly ["Reward"];
};
};
} = ...
Type Declaration
Readonly/v1/reward: {
get: {
description: "Search for issued rewards.\n\nThis search capability supports the ability to nominate search criteria such as:\n\n- Date ranges\n- Pagination\n- Limits\n- Sorting";
querystring: TObject<
{
after: TOptional<TString>;
ascending: TOptional<TBoolean>;
before: TOptional<TString>;
category: TOptional<TString>;
limit: TOptional<TNumber>;
page: TOptional<TNumber>;
phone: TOptional<TString>;
transactionType: TOptional<TUnsafe<"CREDIT" | "DEBIT">>;
},
>;
response: {
"200": TObject<
{
data: TArray<
TObject<
{
amount: TObject<{ amount: ...; currency: ... }>;
category: TOptional<TString>;
createdAt: TString;
id: TString;
idempotencyKey: TString;
note: TOptional<TString>;
phone: TString;
transactionType: TUnsafe<(...) | (...)>;
},
>,
>;
hasNext: TBoolean;
pagination: TObject<{ limit: TNumber; page: TNumber }>;
},
>;
"400": TUnion<
[
TObject<{ code: TLiteral<"INVALID_PHONE">; message: TString }>,
TObject<{ code: TLiteral<"INVALID_ENTITY_TYPE">; message: TString }>,
TObject<{ code: TLiteral<"ENTITY_NOT_FOUND">; message: TString }>,
TObject<
{
code: TLiteral<"INVALID_REQUEST">;
errors: TOptional<TArray<TObject<(...)>>>;
message: TString;
},
>,
],
>;
};
summary: "Search Rewards";
tags: readonly ["Reward"];
};
post: {
body: TObject<
{
amount: TObject<{ amount: TNumber; currency: TLiteral<"MOVEUSD"> }>;
category: TOptional<TString>;
idempotencyKey: TString;
note: TOptional<TString>;
phone: TString;
transactionType: TUnsafe<"CREDIT" | "DEBIT">;
},
>;
description: "Create a reward for a specific CFX Identity.\n\nRewards are issued to a recipient through their phone number. Consequently Rewards can be issued to a recipient Identity prior to them registering within the CFX Network, which allows the creation of a Reward prior to recipient registration.\n\nRewards are managed within the CFX Platform as a ledger mechanism aligning with double entry account priciples. The issuance of a Reward to a recipient Identity results two matching entries:\n\n- A `CREDIT` entry of the `amount` against the recipient Identity account\n- A `DEBIT` entry of the `amount` against the reward issuer\n\nThe ledger allows the system to flexibily manage the growing Reward assets and liabilities for recipients and our CFX partners.\n\nWhen creating a reward the body must contain:\n\n- The `phone` of the recipient.\n- An `idempotencyKey` for the request, which is used to filter out duplicate reward issuances. Each invocation of the Create Reward endpoint should nominate a unique idempotency key.\n- A `category` for the reward, which is a free text field used to support client reporting and reconciliation.\n- A `transactionType` which indicates whether this is a `CREDIT` (add to reward balance) or `DEBIT` (reduce reward balance). Typically these will be `CREDIT` transactions.\n- A free text `note` to be associated with the Reward instance.";
response: {
"201": TObject<
{
amount: TObject<{ amount: TNumber; currency: TLiteral<"MOVEUSD"> }>;
category: TOptional<TString>;
createdAt: TString;
id: TString;
idempotencyKey: TString;
note: TOptional<TString>;
phone: TString;
transactionType: TUnsafe<"CREDIT" | "DEBIT">;
},
>;
"400": TUnion<
[
TObject<{ code: TLiteral<"INVALID_PHONE">; message: TString }>,
TObject<{ code: TLiteral<"INVALID_ENTITY_TYPE">; message: TString }>,
TObject<{ code: TLiteral<"ENTITY_NOT_FOUND">; message: TString }>,
TObject<{ code: TLiteral<"IDEMPOTENCY_ERROR">; message: TString }>,
TObject<{ code: TLiteral<"INVALID_AMOUNT">; message: TString }>,
TObject<
{
code: TLiteral<"INVALID_REQUEST">;
errors: TOptional<TArray<TObject<(...)>>>;
message: TString;
},
>,
],
>;
};
summary: "Create Reward";
tags: readonly ["Reward"];
};
}
Readonly/v1/reward/{id}: {
get: {
description: "Retrieve a specific reward by nominating the Reward ID.";
params: TObject<{ id: TString }>;
response: {
"200": TObject<
{
amount: TObject<{ amount: TNumber; currency: TLiteral<"MOVEUSD"> }>;
category: TOptional<TString>;
createdAt: TString;
id: TString;
idempotencyKey: TString;
note: TOptional<TString>;
phone: TString;
transactionType: TUnsafe<"CREDIT" | "DEBIT">;
},
>;
"404": TObject<{ code: TLiteral<"NOT_FOUND">; message: TString }>;
};
summary: "Get Reward";
tags: readonly ["Reward"];
};
}
Readonly/v1/reward/balance: {
get: {
description: "Retrieve the reward balance associated with a CFX customer. The balance illustrates the total financial exposure of the currently issued rewards.\n\nThe customer is not explicitly provided as input, but is instead mapped from the API credentials provided.";
querystring: TIntersect<
[
TObject<{ count: TOptional<TBoolean> }>,
TObject<{ inventory: TOptional<TBoolean> }>,
],
>;
response: {
"200": TIntersect<
[
TIntersect<
[
TObject<{ amount: TObject<(...)> }>,
TObject<
{ creditCount: TOptional<(...)>; debitCount: TOptional<(...)> },
>,
],
>,
TObject<
{ rewardInventoryWallet: TOptional<TIntersect<[(...), (...)]>> },
>,
],
>;
};
summary: "Get Customer Reward Balance";
tags: readonly ["Reward"];
};
}
Readonly/v1/reward/balance/{phone}: {
get: {
description: "Retrieve the reward balance for a specific recipient Identity by nominating their phone number.";
params: TObject<{ phone: TString }>;
querystring: TObject<{ count: TOptional<TBoolean> }>;
response: {
"200": TIntersect<
[
TObject<
{ amount: TObject<{ amount: TNumber; currency: TLiteral<(...)> }> },
>,
TObject<
{ creditCount: TOptional<TNumber>; debitCount: TOptional<TNumber> },
>,
],
>;
"400": TUnion<
[
TObject<{ code: TLiteral<"INVALID_PHONE">; message: TString }>,
TObject<{ code: TLiteral<"INVALID_ENTITY_TYPE">; message: TString }>,
TObject<{ code: TLiteral<"ENTITY_NOT_FOUND">; message: TString }>,
TObject<
{
code: TLiteral<"INVALID_REQUEST">;
errors: TOptional<TArray<TObject<(...)>>>;
message: TString;
},
>,
],
>;
};
summary: "Get Identity Reward Balance";
tags: readonly ["Reward"];
};
}