Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Gateway: MarkRefRelation

Rest API

Make a reference between transfer transaction with your ref code

POST https://cbridge-prod2.celer.app/v2/partner/markRefRelation

Path Parameters

NameTypeDescription
transfer_id*Stringon-chain transaction transfer id
ref_idStringyour ref code

GRPC-Web API

// import getTransferConfig request message 
import {
  MarkRefRelationRequest
} from "../ts-proto/sgn/gateway/v1/gateway_pb";

// import grpc-web WebClient
import { 
  WebClient 
} from "../ts-proto/sgn/gateway/v1/GatewayServiceClientPb";

const request = new MarkRefRelationRequest();
request.setTransferId(YOUR_TRANSFER_ID);
request.setRefId(YOUR_REF_CODE);

const client = new WebClient(`https://cbridge-prod2.celer.app`, null, null);
const response = await client.markRefRelation(request, null);

Request Parameters

NameTypeDescription
transfer_idStringAuto-generated transferId
ref_idStringYour reference code

TransferId Generation

Since there are different types of transfer provided by cBridge, you should use corresponding transfer id generation logic, please refer following links.

Note: The best practice for markRefRelation is notifying cBridge gateway after on-chain transaction has been submitted.

Response

Since this request is notifying cBridge gateway one transfer is related to a ref code, normal response returns an empty body.